Merge unmerged particular cells with macro

pincivma

Board Regular
Joined
Dec 12, 2004
Messages
206
I unmerged about 500 merged cells in a worksheet by running the below macro. I did this so that I could run another macro that was giving me problems due to these 500 merged cells. But after I run the macro, I need to merge all those 500 cells again. Is there a macro that can do that? I do not want to waste hours merging all those 500 cells that I unmerged. Thanks

Sub UnmergeAllCells()
ActiveSheet.Cells.UnMerge
End Sub
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Re: Merge unmerged paqricular cells with macro

Depends on where the merged cells are !
There is no quick fix, but if the cells are in consistent rows / columns a loop MIGHT be able to get it done.
Otherwise tying in all the ranges to merge would take as long as it would to do the merges manually.

Having said all that I'd avoid merged cells at any cost, as they create havoc in spreadsheets, sorting, filtering, copying !!!
 
Upvote 0
Re: Merge unmerged paqricular cells with macro

Thanks for your answer. Most of the merged cells are on every other row. I don't know how to use the mod function in a macro to merge them back.
 
Upvote 0
Re: Merge unmerged paqricular cells with macro

you would need to provide more detail on the locations of the merged cells for anyone to assist further.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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