Basic excel vba problem

djurmann

Board Regular
Joined
Jan 13, 2006
Messages
246
Hi folks,

I am trying to unmerge some cells in VBA....the code I have is this

Range("a3:b1433").Select.UnMerge

It does not work giving a runtime '424' object required response. What I wonder is what does this mean and why doesn't the code work?

Many thnaks,

Danny
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Why have you got "Select" in your statement. You aren't trying to select the range.
 
Upvote 0
Hi Glenn,

What I am trying to do ultimately is this. Column a is merged into three rwo blocks e.g. a3:a5 is merged. a6:a8 is merged. I want to unmerge these cells, copy the text from cell a3 to a4 and a5. copy the text from a6 to a7 and a8, sort the column and then remerge the cells. I figured a good start would be to select the range and unmerge it.

Danny
 
Upvote 0
I figured a good start would be to select the range and unmerge it.
... that's 2 actions, which you are trying to do in one statement.

For the record, most Excel actions can be performed without having to do a Select beforehand. So:
Code:
Range("a3:b1433").UnMerge
would have been a better start.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,739
Members
448,989
Latest member
mariah3

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