sheet names and representing a date

Y

yorkeyite

Hi
I have a workbook that each sheet tab needs to be named the after a
particular date in its worksheet. This is so that the contents can be
imported into a database as they are updated. The dates have to be
presented "yyyymmdd" with no dividers. Obviously it is a
representation of a date and not the real thing. I am always getting
errors because currently the sheets are being named manually with many
mistakes. The sheet name comes from an actual date in cell E5

I have some vba to do it, but it is clumsy, using year month and day
functions combined with conditional statements to allow for single
figure months and days. It takes up many lines.

Has anybody got anything neat and tidy?
 
Y

yorkeyite

Hi

Sheet.name = Format(Range("E5"),"yyyymmdd")

Sorry does not work, get an object required error, tried addressing
the sheet it was in specifically and that did not work either
 

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