Exel VBA - Sheets.Name

T

Timse

Hi everybody!

I have a following kind of problem and I'm very pleased if somebod
could help me.

I'm trying to name a sheet with a name referring to cell.

Here is an example what I'm trying to do:

I have a date in cell "A1" which is changing every day and I would lik
to write a macro which creates a new name to old sheet when I do th
macro. If the original sheet is called “Sheet1” after doing this macr
it should be e.g. “Sheet118.6.2004” or “18.6.2004”.

I tried to find a way to do this with Sheets.Name, but I couldn’t fin
the right way. Actually I don’t now if it’s even possible but I hop
that somebody knows.


Thank you very much if you could help me!

-Tims
 
M

mangesh_yadav

this should do the trick

Sub SheetName()
dt = Format(Date, "dd.mm.yy")
ActiveSheet.Name = "Sheet-" & dt
End Sub


- Mangesh
Goa, Indi
 

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