Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheets - Add / Move between
I have a workbook with 3 sheets and data on the first
sheet only. I want to add a sheet (4) after sheet (3). Then copy data from sheet (1) onto sheet (4). I then want to add a sheet (5) after sheet (4) and copy different data from sheet (1) onto sheet (5). I then want to add sheet (6) after sheet (5) and copy a third set of data from sheet 1 to sheet (6). I need to continue adding sheets after the last sheet added until I have no more data to copy. I'm having trouble (1) identifying the last sheet to add a new sheet after and (2) moving back to sheet (1). Any help you could provide in adding sheets without speicifying a sheet name and moving between the sheets without specifying sheet names would be greatly appreciated. I'm sure you can do this with a variable or array but I'm not having much luck today. Thanks again for the help....Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheets - Add / Move between
This code should do what you want: ' Find how many sheets are in the workbook Dim No_Sheets No_Sheets = Sheets.Count ' Add a new sheet Sheets.Add ' The new sheet is the active sheet. Move it to after the last sheet ActiveSheet.Move After:=Sheets(No_Sheets + 1) HTH Helen -----Original Message----- I have a workbook with 3 sheets and data on the first sheet only. I want to add a sheet (4) after sheet (3). Then copy data from sheet (1) onto sheet (4). I then want to add a sheet (5) after sheet (4) and copy different data from sheet (1) onto sheet (5). I then want to add sheet (6) after sheet (5) and copy a third set of data from sheet 1 to sheet (6). I need to continue adding sheets after the last sheet added until I have no more data to copy. I'm having trouble (1) identifying the last sheet to add a new sheet after and (2) moving back to sheet (1). Any help you could provide in adding sheets without speicifying a sheet name and moving between the sheets without specifying sheet names would be greatly appreciated. I'm sure you can do this with a variable or array but I'm not having much luck today. Thanks again for the help....Mike . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
move between worksheets using the keyboard | Excel Worksheet Functions | |||
Can't move between worksheets | Excel Worksheet Functions | |||
Move between worksheets | Excel Worksheet Functions | |||
How do I move information between worksheets? | Excel Worksheet Functions | |||
Worksheets - Add / Move between | Excel Programming |