Naming a worksheet a cell's date value

A

abxy

Hi, I'm trying to create a workbook that will have data from each wor
day of the month on different worksheets.

So i'm trying to create a macro that will create a new worksheet an
name it the date value that's in cell A8.

The problem is, when I create and edit the macro so that it display
the date value in cell A8, excel renames the worksheet to it's interna
date value (which is a weird number). How can I make it so that th
worksheet is renamed to the date value in cell A8 in the forma
"mm-dd-yy" ...actually it'd be even better if it was as simple as
"dd" format only displaying the day number of the month.

Thanks in advanc
 
P

Peo Sjoblom

You can set the format in the macro although you cannot use forbidden
characters
I would probably use mm_dd_yy

Format(cell.Value, "mm_dd_yy")
 
A

abxy

hmm, ok, but how do i do that?

this is what I know:

Sheets("Sheet1").Select
Sheets("Sheet1").Name = Range("A8")

where and how do i put in the code so that excel "knows" that cell A8
is a date and that the worksheet should be named accordingly?
 
P

Peo Sjoblom

You could use

Worksheets("Sheet1").Name = Format(Range("a8").Value, "mm_dd_yy")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top