Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "joemeshuggah" wrote: 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) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 On May 7, 2:49*pm, Joel wrote: 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 "joemeshuggah" wrote: 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)- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pulling dates meeting certain criteria into different TABs | Excel Discussion (Misc queries) | |||
Vlookup Different tabs based on Dates | Excel Worksheet Functions | |||
tabs are missing even though 'tools-options-view-sheet tabs' ok? | Excel Worksheet Functions | |||
hide tabs from view then lock tabs? | Excel Discussion (Misc queries) | |||
Worksheet Tabs Names as Dates | Excel Worksheet Functions |