Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy paste merged cells
Hi,
The following code gives me "cannot change part of a merged cell" because each of the rows (H to K) that I am copy/pasting are merged. I have tried just to use H5:H23 as the range but that didn't work either. Can someone suggest something? I have the following code: Public Sub Sheet1() Dim srcWb As Workbook Dim destWb As Workbook Dim srcSH As Worksheet Dim destSH As Worksheet Dim srcRng As Range Dim destRng As Range Set srcWb = Workbooks("Source Workbook.xls") Set destWb = Workbooks("Destination Workbook.xls") Set srcSH = srcWb.Sheets("Source Worksheet") Set destSH = destWb.Sheets("Destination Worksheet") srcSH.Range("H5:K23").Copy Destination:=destSH.Range("H5:K23") End Sub Thanks, Ivano |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy paste non merged to merged cells | Excel Worksheet Functions | |||
Copy/Paste into merged cells | Excel Discussion (Misc queries) | |||
Copy/Paste formulas in merged cells | Excel Discussion (Misc queries) | |||
Macro to Add Row and Copy/Paste Merged Cells | Excel Programming | |||
Copy and paste of sheets via VBA code that has merged cells | Excel Programming |