PC Review


Reply
Thread Tools Rate Thread

copy paste merged cells

 
 
Ivano
Guest
Posts: n/a
 
      12th May 2009
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy paste non merged to merged cells jamalhakem@gmail.com Microsoft Excel Worksheet Functions 1 5th Feb 2009 05:25 PM
Copy/Paste into merged cells NicoleS Microsoft Excel Misc 2 29th Dec 2008 11:48 PM
Copy/Paste formulas in merged cells Excel User 123456 Microsoft Excel Misc 2 18th Dec 2008 07:58 PM
Macro to Add Row and Copy/Paste Merged Cells =?Utf-8?B?ZGlwaXR1ZHVkYTI=?= Microsoft Excel Programming 1 2nd Aug 2006 02:30 PM
Copy / Paste Merged Cells LPS Microsoft Excel Misc 1 26th Jun 2004 01:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:40 AM.