Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Select the ActiveSheet & the sheet next to it
Hi,
how do I have a macro to select the activesheet and the sheet next to it and then to copy them and insert as new sheets (both of them)? Note that for the macro, i do not want it to have specific Named sheets. Thanks. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Select the ActiveSheet & the sheet next to it
You left out a few minor details but this should get you to the right place.
Selects the active sheet and the one next to it (to the right) and copies to a new workbook. Sub selectSheets() isheet1 = ActiveSheet.Index isheet2 = ActiveSheet.Index + 1 Sheets(Array(isheet1, isheet2)).Select Sheets(Array(isheet1, isheet2)).Copy End Sub -- -John Please rate when your question is answered to help us and others know what is helpful. "Dolphinv4" wrote: Hi, how do I have a macro to select the activesheet and the sheet next to it and then to copy them and insert as new sheets (both of them)? Note that for the macro, i do not want it to have specific Named sheets. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't get ActiveSheet to work... | Excel Discussion (Misc queries) | |||
Check Activesheet for chart sheet or work sheet | Charts and Charting in Excel | |||
How do I select price from sheet.b where sheet.a part no = sheet.b | Excel Worksheet Functions | |||
Use Sheet CodeNames to Select Sheet in Different Workbook | Excel Discussion (Misc queries) | |||
Macro, select Sheet "Number", NOT Sheet Name | Excel Worksheet Functions |