Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi everyone -
I have a spreadsheet with multiple tabs. I have a need at the start of the month to copy several sections on different tabs to other places on those same tabs. Right now the macro I developed copies a single section to another place: Range("A17:P30") = Range("A2:P15").Value I would like to stack these types of commands within a single macro to do the copying of the various sections but I don't know how to, within the macro, switch tabs. Any help would be appreciated. Amy |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Your code doesn't really copy the values--it just assigns them.
And you don't have to select/activate a worksheet to work on it. worksheets("sheet999").range("A17:P30").value _ = worksheets("sheet888").range("a2:p15").value If you want to copy, er, assign a specific range from a specific sheet, you could activate the new sheet and then use something like: ActiveSheet.range("A17:P30").value _ = worksheets("myMasterSheetNameHere").range("a2:p15" ).value cvgairport wrote: Hi everyone - I have a spreadsheet with multiple tabs. I have a need at the start of the month to copy several sections on different tabs to other places on those same tabs. Right now the macro I developed copies a single section to another place: Range("A17:P30") = Range("A2:P15").Value I would like to stack these types of commands within a single macro to do the copying of the various sections but I don't know how to, within the macro, switch tabs. Any help would be appreciated. Amy -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Amy,
To programatically switch tabs, try: Sheets("Sheet2").Select Substitute Sheet2 with the name(s) of your sheet tabs. Please press Yes if this helped you. JCS "cvgairport" wrote: Hi everyone - I have a spreadsheet with multiple tabs. I have a need at the start of the month to copy several sections on different tabs to other places on those same tabs. Right now the macro I developed copies a single section to another place: Range("A17:P30") = Range("A2:P15").Value I would like to stack these types of commands within a single macro to do the copying of the various sections but I don't know how to, within the macro, switch tabs. Any help would be appreciated. Amy |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks! it appears to work!
"JCS" wrote: Hi Amy, To programatically switch tabs, try: Sheets("Sheet2").Select Substitute Sheet2 with the name(s) of your sheet tabs. Please press Yes if this helped you. JCS "cvgairport" wrote: Hi everyone - I have a spreadsheet with multiple tabs. I have a need at the start of the month to copy several sections on different tabs to other places on those same tabs. Right now the macro I developed copies a single section to another place: Range("A17:P30") = Range("A2:P15").Value I would like to stack these types of commands within a single macro to do the copying of the various sections but I don't know how to, within the macro, switch tabs. Any help would be appreciated. Amy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions |