LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Dynamic copy range

Afternoon,

I have a file with 10 different sheets in it. I have a macro part of which
is attached below, which copies the format from a set of cells in sheet 1 and
copies them into sheet 2. I need to do this for all 10 sheets - take the
format thats in cells cells P10 to A109 from sheets 1 and copy it to sheet 2,
then sheet 3, sheet 4 etc etc. All copying is from sheet 1.

Is it possible to have one formula that will loop through the sheets without
me having to repeat the same code 10 times?

Thanks

Sheets("1").Range("P10:AA109").Copy
Sheets("2").Range("P10").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

Next code would be (exactly the same apart from sheet ref in second line

Sheets("1").Range("P10:AA109").Copy
Sheets("3").Range("P10").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
 
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
Copy dynamic range Sandy Excel Programming 3 April 18th 08 08:14 PM
Macro to copy a certain a cell to a dynamic range Frank Situmorang[_2_] Excel Programming 5 March 14th 08 04:26 AM
copy a dynamic column range in macro? will-d Excel Programming 4 January 16th 08 08:01 PM
Copy via code from a dynamic range using offeset Greg[_21_] Excel Programming 5 August 8th 05 05:13 PM
Dynamic range copy. sungen99[_22_] Excel Programming 1 June 10th 05 04:44 PM


All times are GMT +1. The time now is 08:10 AM.

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"