Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi All,
I've got a macro that will paste a rectangle on a sheet. That's easy. The hard part is that I want it to do that only across selected sheets in a workbook, say sheets 1, 2, 5, 8, and 10 of 10sheets. I can get it on one sheet at a time, as well as ALL the sheets in a workbook, just not those specific ones. Any ideas? Thanks in advance, Stephan |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Isn't this resolved a few days ago?
-- Regards wrote in message ups.com... Hi All, I've got a macro that will paste a rectangle on a sheet. That's easy. The hard part is that I want it to do that only across selected sheets in a workbook, say sheets 1, 2, 5, 8, and 10 of 10sheets. I can get it on one sheet at a time, as well as ALL the sheets in a workbook, just not those specific ones. Any ideas? Thanks in advance, Stephan |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
1- in vba (Alt + F11) ,insert a module.
2- Write this: Sub MyPaste() Selection.Copy Sheets(Array("Sheet2", "Sheet3")).Select 'or any sheet you want Sheets("Sheet2").Activate ' one of your sheet Range("E20").Select ' your 1st cell in paste range ActiveSheet.Paste End Sub " wrote: Hi All, I've got a macro that will paste a rectangle on a sheet. That's easy. The hard part is that I want it to do that only across selected sheets in a workbook, say sheets 1, 2, 5, 8, and 10 of 10sheets. I can get it on one sheet at a time, as well as ALL the sheets in a workbook, just not those specific ones. Any ideas? Thanks in advance, Stephan |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub test()
Dim ws As Worksheet Set MySheets = ThisWorkbook.Worksheets(Array("Sheet1", "Sheet2", "Sheet3")) 'or if you select the sheets with CTRL + Click 'Set MySheets = ActiveWindow.SelectedSheets For Each ws In MySheets 'do your stuff Next ws End Sub Gord Dibben MS Excel MVP On 21 Jan 2007 20:32:46 -0800, wrote: Hi All, I've got a macro that will paste a rectangle on a sheet. That's easy. The hard part is that I want it to do that only across selected sheets in a workbook, say sheets 1, 2, 5, 8, and 10 of 10sheets. I can get it on one sheet at a time, as well as ALL the sheets in a workbook, just not those specific ones. Any ideas? Thanks in advance, Stephan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to run relative to current selected cell | Excel Discussion (Misc queries) | |||
Macro Help (Uppercase multiple ranges?) | Excel Discussion (Misc queries) | |||
Macro pulling data from 2 worksheets | Excel Discussion (Misc queries) | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Record Macro Relative does not work? | Excel Discussion (Misc queries) |