Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 772
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get ActiveSheet to work... [email protected] Excel Discussion (Misc queries) 2 August 16th 07 06:12 PM
Check Activesheet for chart sheet or work sheet NSK Charts and Charting in Excel 1 July 17th 07 09:00 PM
How do I select price from sheet.b where sheet.a part no = sheet.b Sonny Excel Worksheet Functions 4 April 4th 06 05:08 PM
Use Sheet CodeNames to Select Sheet in Different Workbook Randy Excel Discussion (Misc queries) 1 June 10th 05 12:17 AM
Macro, select Sheet "Number", NOT Sheet Name DAA Excel Worksheet Functions 4 November 30th 04 05:29 PM


All times are GMT +1. The time now is 06:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"