Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Worksheet range copy

I am trying to copy a range across to some worksheets so that these are basically a
replicate of the source worksheet initially. This does effectively what I am after

Sheets("Sheet1").Cells.Copy Destination:=Sheets("Sheet3").Cells

I just wonder if this is not a hammer to crack a nut. The exact range tranfer required is

Sheets("Sheet1").Range("A1:P40").Copy Destination:=Sheets("Sheet3").Range("A1:P40")

This however does not copy across column widths etc although it takes all the text and
formulas. The first transfer does this however. Is there a tidier way to do this
remembering that I will be going through a loop to copy the source to several worksheets.
I value any help.

Graham
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Worksheet range copy

One way

Sub marine()
Sheets("Sheet1").Range("A1:P40").Copy
With Worksheets("Sheet3").Range("A1")
.PasteSpecial Paste:=xlPasteAll
.PasteSpecial Paste:=xlPasteColumnWidths
.PasteSpecial Paste:=xlPasteFormats
End With
End Sub

Mike

"Graham H" wrote:

I am trying to copy a range across to some worksheets so that these are basically a
replicate of the source worksheet initially. This does effectively what I am after

Sheets("Sheet1").Cells.Copy Destination:=Sheets("Sheet3").Cells

I just wonder if this is not a hammer to crack a nut. The exact range tranfer required is

Sheets("Sheet1").Range("A1:P40").Copy Destination:=Sheets("Sheet3").Range("A1:P40")

This however does not copy across column widths etc although it takes all the text and
formulas. The first transfer does this however. Is there a tidier way to do this
remembering that I will be going through a loop to copy the source to several worksheets.
I value any help.

Graham

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Worksheet range copy

Thanks to you both, Mike and Don. I just wanted the confidence to make sure I was going
down the right road and I am very grateful for your help and guidance.

Graham

Mike H wrote:
One way

Sub marine()
Sheets("Sheet1").Range("A1:P40").Copy
With Worksheets("Sheet3").Range("A1")
.PasteSpecial Paste:=xlPasteAll
.PasteSpecial Paste:=xlPasteColumnWidths
.PasteSpecial Paste:=xlPasteFormats
End With
End Sub

Mike

"Graham H" wrote:

I am trying to copy a range across to some worksheets so that these are basically a
replicate of the source worksheet initially. This does effectively what I am after

Sheets("Sheet1").Cells.Copy Destination:=Sheets("Sheet3").Cells

I just wonder if this is not a hammer to crack a nut. The exact range tranfer required is

Sheets("Sheet1").Range("A1:P40").Copy Destination:=Sheets("Sheet3").Range("A1:P40")

This however does not copy across column widths etc although it takes all the text and
formulas. The first transfer does this however. Is there a tidier way to do this
remembering that I will be going through a loop to copy the source to several worksheets.
I value any help.

Graham

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
copy data from a range of worksheet psp Excel Programming 2 January 18th 05 08:08 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie[_2_] Excel Programming 2 September 22nd 04 03:30 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie[_3_] Excel Programming 0 September 22nd 04 03:26 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM
How? Macro to copy range to new worksheet, name new worksheet, loop Repoman Excel Programming 9 October 9th 03 01:45 PM


All times are GMT +1. The time now is 08:07 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"