#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Macro

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro

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   Report Post  
Posted to microsoft.public.excel.misc
JCS JCS is offline
external usenet poster
 
Posts: 93
Default Macro

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Macro

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
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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM


All times are GMT +1. The time now is 01:37 PM.

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

About Us

"It's about Microsoft Excel"