Putting the date as a sheet name

M

matthewwookie

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
 
P

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" <[email protected]>
a écrit dans le message de [email protected]...
 
M

matthewwookie

Hi

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

Any ideas?

Mat
 
P

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" <[email protected]>
a écrit dans le message de [email protected]...
 
Top