Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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
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 paste non merged to merged cells [email protected] Excel Worksheet Functions 1 February 5th 09 05:25 PM
Copy/Paste into merged cells NicoleS Excel Discussion (Misc queries) 2 December 29th 08 11:48 PM
Copy/Paste formulas in merged cells Excel User 123456 Excel Discussion (Misc queries) 2 December 18th 08 07:58 PM
Macro to Add Row and Copy/Paste Merged Cells dipitududa2 Excel Programming 1 August 2nd 06 02:30 PM
Copy and paste of sheets via VBA code that has merged cells John Corbin Excel Programming 3 December 19th 04 02:23 PM


All times are GMT +1. The time now is 01:34 PM.

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"