ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Putting the date as a sheet name (https://www.excelbanter.com/excel-discussion-misc-queries/47174-putting-date-sheet-name.html)

matthewwookie

Putting the date as a sheet name
 

Hi

I've created some macros that create different sheets within a file.

However, i'd like each sheet to display the date along with a pre
defined name.

Is it possible to incorporate this into the macro.....if so, how would
i do it?

Thanks

Matt


--
matthewwookie
------------------------------------------------------------------------
matthewwookie's Profile: http://www.excelforum.com/member.php...o&userid=27503
View this thread: http://www.excelforum.com/showthread...hreadid=470722


papou

Hello Matt
You don't say how you have created your sheets, so provided all sheets have
to be renamed in your workbook, you could use something like this:
Dim wsh As Worksheet
For Each wsh In ThisWorkbook.Worksheets
wsh.Name = wsh.Name & "_" & Format(Date, "mmddyy")
Next wsh

HTH
Cordially
Pascal

"matthewwookie"
a écrit dans le message de news:
...

Hi

I've created some macros that create different sheets within a file.

However, i'd like each sheet to display the date along with a pre
defined name.

Is it possible to incorporate this into the macro.....if so, how would
i do it?

Thanks

Matt


--
matthewwookie
------------------------------------------------------------------------
matthewwookie's Profile:
http://www.excelforum.com/member.php...o&userid=27503
View this thread: http://www.excelforum.com/showthread...hreadid=470722




matthewwookie


Hi

Thanks for that, the sheets are produced by a macro and its only the
ones that are produced that way need to be renamed. all original sheets
in the book should stay as they are.

Any ideas?

Matt


--
matthewwookie
------------------------------------------------------------------------
matthewwookie's Profile: http://www.excelforum.com/member.php...o&userid=27503
View this thread: http://www.excelforum.com/showthread...hreadid=470722


papou

Matt
As I said it depends on how your macro creates the worksheets.
If your macro uses a "For Next" loop then you can use as a start the sample
code I supplied.
But I suggest you post the macro here so that we can help you further.

Cordially
Pascal



"matthewwookie"
a écrit dans le message de news:
...

Hi

Thanks for that, the sheets are produced by a macro and its only the
ones that are produced that way need to be renamed. all original sheets
in the book should stay as they are.

Any ideas?

Matt


--
matthewwookie
------------------------------------------------------------------------
matthewwookie's Profile:
http://www.excelforum.com/member.php...o&userid=27503
View this thread: http://www.excelforum.com/showthread...hreadid=470722





All times are GMT +1. The time now is 02:47 PM.

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