tabs by dates

  • Thread starter Thread starter joemeshuggah
  • Start date Start date
J

joemeshuggah

Not sure that this is possible by simply recording a macro. Is there a way
to code this by visual basic?

I have a spreadsheet that has a request date column...I am looking to create
a macro that creates a tab for each year, and then takes the information in
the spreadsheet and breaks it out by tab (e.g taking a workbook with one tab
for years 2003-2008, and making a workbook with six tabs showing information
by year)
 
You can record a macro and then make simply changes as required.

here is the code for adding the sheets


For MyYear = 2003 To 2008
Set newsht = Sheets.Add(after:=Sheets(Sheets.Count))
newsht.Name = MyYear
'add recorded code here with modification to use newsht
Next MyYear


for MyYear = 2003 to 2008
sheets.add after:=sheets(sheets.count)
activesheet.name = MyYear
next MyYear
 
Joe

Without knowing the format of your data I can't be sure, but, it seems
like this may be something well suited to a pivot table, applying the
Show Pages option.

If the data is suitable to a pivot table you can put the year in the
Page Field, elect to Show Pages, and you will have a sheet for each
year with the data, without a macro or without doing much of anything.

Good luck.

Ken
Norfolk, Va
 
Back
Top