ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Exel VBA - Sheets.Name (https://www.excelbanter.com/excel-programming/301854-exel-vba-sheets-name.html)

Timse[_2_]

Exel VBA - Sheets.Name
 
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

--
Message posted from http://www.ExcelForum.com


mangesh_yadav[_17_]

Exel VBA - Sheets.Name
 
this should do the trick

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


- Mangesh
Goa, Indi

--
Message posted from http://www.ExcelForum.com


Timse[_3_]

Exel VBA - Sheets.Name
 
Thanks!

It really works! :cool:

-Tims

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 07:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com