PDA

View Full Version : Solved: Copying merged cells



Dowsey1977
09-15-2005, 05:56 AM
Hi,

I'm using the below code to copy and paste a piece of data from 1 sheet to another. E98:G98 are merged cells, but the desitination is a single cell. So when I paste the data is putting the information in the right cell, but then clearing whatever is in the adjacent 2 cells. Is there anyway to get it to paste to just a single cell, and not overwrite the adjacent cells?

I have tried just copying E98, it worked on a newer PC, but on Excel 97 I get an error message saying "Can't change the contents of merged cells".


Range("E98:G98").Copy
Sheets("30 CUR (10)").Select
Range("D30").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

Any ideas??

shades
09-15-2005, 06:24 AM
Howdy. Another reason never, never use merged cells, unless forced to do so at gun point, but make sure the gun is loaded and hammer cocked, before you begin using merged cells, and then only for display purposes after you have completed all work. ;)

Perhaps see whether you can use "Center Across Selection" instead of merged cells. That will allow you to do what you want. Get rid of the merged cells in the target worksheet first.

Dowsey1977
09-15-2005, 07:07 AM
OK....have taken your advice on this...will just hope my seniors approve!!

Thanks!