Change Column Font Color Based on Header

Michael151

Board Regular
Joined
Sep 20, 2010
Messages
247
<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--> Hello all,

Trying to write a macro that will change the color and font of a particular column based on the header in row 1.

For the column labeled New_Deal, anything in this column starting in row 2 will be changed to red and bold font.

Before:

Row1 Col1 New_Deal
Row2 Col2 Col2
Row3 Col3 Col3
Row4 Col4 Col4
Row5 Col5 Col5

After:

Row1 Col1 New_Deal
Row2 Col2 Col2
Row3 Col3 Col3
Row4 Col4 Col4
Row5 Col5 Col5

The “New_Deal” column can be in any column letter, which is why I’d like to use the header in row 1 to identify this column.

Any help is most appreciated – thanks!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
The New_Deal column is not always in column 2, it can be in any letter column, which is why I'd like to use the header in row 1 to identify this column.

I'm also trying to incorporate this function into a larger macro and I'm trying to automate most of the process.
 
Upvote 0
how far have you got with this Macro as it appears you are asking for that part further down this page,

In it you say insert a column and then it does not matter where it is,

I would need to understand fully what you want and then I should be able to help

So far it looks to me that you could write New_Col 2 in col b format the column red and bold and copy and paste down.

which by the way is fine but put it all together.
 
Upvote 0
Sure, this might make it easier - let me rephrase:

In the column labeled "New_Deal", (which can be in any letter column - identified by row 1 header), any instance of the word "New" in this column should be bold red.

Does that make sense?
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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