Run-Time Error 1004 Cannot Change Part of a Merged cell.

dosborn

New Member
Joined
Dec 21, 2011
Messages
12
I am getting Run-time error 1004 "Cannot Change Part of a Merged Cell". I am trying to copy Sheet1 cell E11 (merged cells E11:G11) to Sheet2 cell E11 (merged cells E11:G11). Can someone please help me figur out where I am going wrong. Thanks.

Sub PartBalance()

With Sheets("PART REQUEST")

If Range("D11").Value - Range("K11").Value <> 0 Then

Range("B11").Copy Sheets("PURCHASE REQUISITION").Range("M11")
Range("E11").Copy Sheets("PURCHASE REQUISITION").Range("E11")

End If

End With

Sheets("PURCHASE REQUISITION").Range("C11").Value = Sheets("PART REQUEST").Range("T11").Value

If Sheets("PURCHASE REQUISITION").Range("C11").Value > 0 Then

MsgBox "Purchase Requisition Needed " & Sheets("PART REQUEST").Range("E11").Value

End If
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Merged cells are best avoided (Horizontal Alignment=XLCenter achieves the same visual effect). However, try

Code:
Range("E11").Copy Sheets("PURCHASE REQUISITION").Range("E11").Resize(, 3)
 
Upvote 0
Well, the error pretty much says it all...
You can't change PART (E11) of a Merged Range (E11:G11).

You have to copy/paste the WHOLE merged range.
Range("E11:G11").Copy Sheets("PURCHASE REQUISITION").Range("E11:G11")


Or, avoid using merged cells to begin with.
Merged Cells and VBA go together about as well as Oil And Water.

A very similar effect can be achieved with "Center Accross Selection"
Found in format - Cells - Alignment - Text alighnemt - Horizontal Dropdown.
 
Upvote 0
Thank you very much. I tried that before but I must have not had the right cell range or something. It is difficult because I m trying to make a form for ordering parts that can work automated or if my employees need to fill it out by hand it is functional that way too. Anyhow. Thanks for the help.
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top