ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro code to change tab name (https://www.excelbanter.com/excel-programming/333687-macro-code-change-tab-name.html)

TurboBeagle

Macro code to change tab name
 

Does anyone know the vba code for changing a tab to the current date?
I have the code to create a string that is the current date, and have
applied that to other things, such as a new file name. I can't seem
to find how to apply that as a tab name.


Thanks.


--
TurboBeagle
------------------------------------------------------------------------
TurboBeagle's Profile: http://www.excelforum.com/member.php...o&userid=23415
View this thread: http://www.excelforum.com/showthread...hreadid=384694


Dave Peterson[_5_]

Macro code to change tab name
 
activesheet.name = format(date,"yyyy_mm_dd")

is one way.

Remember that worksheet names can't include the slash character.



TurboBeagle wrote:

Does anyone know the vba code for changing a tab to the current date?
I have the code to create a string that is the current date, and have
applied that to other things, such as a new file name. I can't seem
to find how to apply that as a tab name.

Thanks.

--
TurboBeagle
------------------------------------------------------------------------
TurboBeagle's Profile: http://www.excelforum.com/member.php...o&userid=23415
View this thread: http://www.excelforum.com/showthread...hreadid=384694


--

Dave Peterson


All times are GMT +1. The time now is 12:06 AM.

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