sheet names and representing a date

  • Thread starter Thread starter yorkeyite
  • Start date Start 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?
 
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
 
Back
Top