Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Copy Problem
On Fri, 3 Sep 2004 11:03:12 -0700, "asmenut"
wrote: I am having some problems when I try to copy a range on one sheet to the same range on other sheets. The range(s) that I am copying are merged cells but when I copy the range, it blows the merge away. Sub CopyData) Dim i as Integer Dim SheetCount as Integer SheetCount = ActiveWorkbook.Sheets.Count for i = 1 to SheetCount Range("F1:I2").Copy (Sheets(i).Range("F1:I2")) Next i End Sub. The problem seems connected to the fact that you, during the copy process, also copy with the same source range and destination range, i.e. on the same sheet. For those destination sheets that come before the source sheet the copying works as you want, but once the data has been copied on itself the cell merging is destroyed on the source sheet and on all sheets following it. Try putting this at the begining of your copy statement If Not Sheets(i) Is ActiveSheet Then Hope this helps Lars-Åke |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy a Range from each workbook - Ron de Bruin VBA - a problem | Excel Worksheet Functions | |||
Copy range content as picture - truncation problem | Excel Programming | |||
Copy range content as picture - truncation problem | Excel Programming | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming | |||
Range COPY function - how to copy VALUES and not formulas | Excel Programming |