VBA to merge cells

slavmob

New Member
Joined
Feb 10, 2015
Messages
4
Hi all,

I'm trying to merge cells based on a certain cell values. For instance, if column A was my helper and B-F represented the weekdays M-F, if the value in A was MT-WTHF I'd like to merge cells BC and DEF. Thanks for any help you can provide!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
in a macro you need to in effect say.....if cells B1 = M and B2 = T then merge B1 and B2

=left(A1,1) = M in the macro the code is =left(cells(1,1),1)

do a record macro and merge 2 cells then examine the code
 
Upvote 0

Forum statistics

Threads
1,216,215
Messages
6,129,557
Members
449,516
Latest member
lukaderanged

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