ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy/Paste Merged Cells via Macro is not working (https://www.excelbanter.com/excel-programming/321807-copy-paste-merged-cells-via-macro-not-working.html)

Peter Bassett

Copy/Paste Merged Cells via Macro is not working
 

I have 6 rows (from R4-R9) that include merged cells that I need to copy
in the sheet over and over in a loop. When I manually copy, it works
fine. My problem is that although the Macro below copies the 6 rows,
none of the merged cells are maintained! All the cells are individual. I
thought PasteFormats maintains the merged cell layout.


' Copy 6 rows
Rows("4:9").Select
Range("C4:C9").Activate
Selection.Copy
Rows(NewRow & ":" & NewRow + 5).Select
Range("C" & NewRow & ":C" & NewRow + 5).Activate
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
<<<<

Any tips on maintaining the Merged Cell formatting in VB?

Thanks,
Pete



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com