excel worksheet re-nameing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an excel spreadsheet, the worksheets are named in date order by day (3 months) I want to be able to change the first 1 and have all the others change to the subsequent dates, is this possible
 
You will need a macro to do this. What is the exact date format tha
you are using for each of the sheet names? Post back with the exac
name of the first few sheets exactly as they appear on the workboo
tabs.


Rolli
 
Here is a sample macro that uses the following format for each of th
tab names *Jan 1, 2004*. Change the name of the first sheet of th
workbook to the first date you want (use the same format as the bolde
date above) and then run the macro below.


Code
-------------------

Public Sub ChangeDates()

Sheets(1).Select
vDate = CDate(ActiveSheet.Name)

For i = 2 To Sheets.Count

vDate = vDate + 1
vDate = Format(vDate, "mmm d, yyyy")
Sheets(i).Name = vDate
vDate = CDate(vDate)

Next i

End Su
 

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

Back
Top