VBA Code for Changing Text Alignment with Merge Cells

Tennisguuy

Well-known Member
Joined
Oct 17, 2007
Messages
564
Office Version
  1. 2016
Platform
  1. Windows
I am not sure if this can be done and I am not good with writing VBA code. I have a spreadsheet where I have merged some cells. I have instructions in the merged cells. I have it formatted to show the instructions in red and aligned center because that is the option I liked best under merged cells. When the user inputs their text the instructions in red then turns to black but the alignment is still centered.

What I would like to do is leave the current formatting in where the instructions are in red and aligned centered but when the user types over the instructions and it changes it to black and keeps the center alignment I would like to change the alignment from center after they input text in the cell to left alignment.

Can that be done.

I have merged cells in four separate places on the worksheet. The first set merging row 10-14, then 18-22 then 46-50 and 53-57
 
Actually the merged cells start with column B sorry about that. Column A was hidden. However I changed your code that had A with B. That didn't work either. I am not sure if this matter but the alignment on the home tab was in the center position and the merge drop down was Merge & Center
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
As I said before, VBA & merged cells don't work well together. Because of that, I don't touch merged cells so not sure what will work & what wont.
 
Upvote 0
Solution
Ok thanks Fluff no problem. I really really appreciate your help in trying to help me.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,316
Members
448,564
Latest member
ED38

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