In one part, the macro copies a long number from a single
(unmerged cell) on one sheet and tries to paste into a
merged cell (formerly 3 horizontal cells) on the Print
Sheet. I get an error message that says, "Cannot change
part of a merged cell."
This confuses me because I am able to copy data from the
SAME sheet and paste it into the nearby merged cell...I
just can't do it from a different sheet. Why?
Thanks
Sheets("Sheet2").Range("C3").Copy _
Destination:=Sheets("Sheet1").Range("A2:C2")
John Dice wrote:
--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html
Here's my actual code, with your suggestion:
ActiveSheet.Range("E1").Copy Destination:=Sheets("Form
195").Range("I4:K4")
I use ActiveSheet because the macro copies data from the
currently active sheet which may change depending on where
the user is.
The macro copies many other cells (all to and from
unmerged cells) and they all work fine. Its just this one
merged cell that blocks the macro.
John Dice
>.
>
Is it possible that this cell is also merged with other cells? Perhaps
there is a hidden row above or below it, and it's merged with cells there.
I am using 2000. Thanks for your help. I obviously have
a bug somewhere in my code or layout and I will keep
looking. At least I know now that it SHOULD work and I'm
not trying to do an impossible task.
Thanks again,
John
>.
>
1. Select cells I4:K4
2. Choose Format>Cells
3. On the Alignment tab, from the Horizontal dropdown, choose 'Centre
Across Selection'
4. Click OK
You could add an outside border around the group of 3 cells to enhance
the illusion that they are merged.
With this technique, you get the appearance of merged cells, but none of
the headaches.
Sheets("Sheet1").Range("C3").Copy _
Destination:=Sheets("Sheet2").Range("A2").MergeArea
Am I too late?
--
Dave Peterson
ec3...@msn.com
Thanks,
John Dice
>>>>>http://www.contextÍ{ wÀ Q <aw
>,ð>QtS ì¸ ures.com/tiptech.html
>>>>>
>>>>>.
>>>>>
>>>>>
>>>>>
>>>
>>>--
>>>
>>>Debra Dalgleish
>>>
>>>Excel FAQ, Tips & Book List
>>>http://www.contextures.com/tiptech.html
>>>
>>>.
>>>
>>>
>
>
>--
>
>Debra Dalgleish
>
>Excel FAQ, Tips & Book List
>http://www.contextures.com/tiptech.html
>
>.
>
For the heck of it try something like
Worksheets("Sheet2").Range("C3").Copy _
Destination:=Worksheets("Sheet1").Range("A2").MergeArea
which would ensure you're pasting into the entire merged area.