Formula to change font color in part of cell only

Nathan Asius

New Member
Joined
Jan 15, 2024
Messages
41
Office Version
  1. 365
Platform
  1. Windows
I have a large table of prices. The column headers in the top row have titles with some duplicates which can't be changed. I can't break up the table into more than one.
Those column headers in the top row also are used to produce a validation list. But that list first shows up in a spill list on another sheet before it gets pulled into the drop down on the user's main dashboard. (As shown in this video from Up4Excel on Unique Lists
). The Drop Down List does not get pulled directly from the header Row of the table.

Furthermore, I have more than a hundred formulas in various places in my workbook that lookup prices in the table through Index/Match formulas. So not much can be done to change to structure or naming of the table fields.

The goal is to get rid of the number that Excel automatically produces in the column header. ie Apples, Apples2, Apples3.
The only solution I came up with was to change the color of that number to white. It didn't appear in the Header now, but it still shows up in the drop-Down list.

So I think I need a formula that will do just that. I've never known a formula being even close to changing a font color. So I'm at a loss here or requiring VBA coding.
I have other column headers in the formula that also have numbers. So the formula needs to do the unique thing of finding a single digit number at the end position of a string of letters without a space in-between, and then change the font color to white. Any other number appearing in these column headers, has spaces around them.

So it will find Apples2 and Apples3 and change those numbers' font color to white. But not do the same when finding Apples 2, Bananas 8, 16 Pecans, or Candy 7 Corn.
Is this possible? Or is there a better solution?

My spill list shows up in D4. And repeats for 8 rows. to D12. ( $D4:$D12 )
The header row has been defined into 4 named ranges: Fruit, Beans, Nuts and Candies.
My Drop Down list appears in another Sheet : Sheet10! E14

Thank you.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Formulas won't change partial text in a cell.
Have a read here for you best options.
 
Upvote 0
Solution
OK. Thanks. I'll Check it out. Hopefully the code is not too complicated for me to customize to my problem.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,111
Members
453,021
Latest member
Justyna P

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