formatting between "(xyzxyz)" in one cell

Kerry Newman

New Member
Joined
Feb 23, 2018
Messages
19
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
All,
I want to format parts of cells in a list like this:
Each name is in one cell, one row each
[TABLE="width: 294"]
<colgroup><col></colgroup><tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD]AR:Central IL (Johns, Andrew)[/TD]
[/TR]
[TR]
[TD]AR:MS South (Luther, Susan)[/TD]
[/TR]
[TR]
[TD]AR:Chicago, IL (Martinez, Ben)[/TD]
[/TR]
[TR]
[TD]AR:Memphis, TN (Glaser, Albert)[/TD]
[/TR]
[TR]
[TD]AR:NE/IA (McGrath, Jason)

I want to make the characters between the ( ) turn white, including the ( ).

For example, AR:Central IL (Johns, Andrew) would still have the full text in the cell (to be used in other formulas) but the cell only shows AR:Central IL
The (Johns, Andrew) part of the text would just be white font, not visible.

How can I do this with out formatting each cell individually? The list is several hundreds of lines long.
Thanks
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You can only do that manually or with VBA. And only if they are hard values, rather than formulae.
Are they hard values & are you happy with VBA?
 
Upvote 0
You can only do that manually or with VBA. And only if they are hard values, rather than formulae.
Are they hard values & are you happy with VBA?

Thanks Fluff, and they are hard values but the list is several hundred rows deep so changing them manually is too time consuming vs. the reward so VBA is probably the best route to go. Thanks!
 
Upvote 0
Ok, how about
Code:
Sub KerryNewman()
   Dim Cl As Range
   Dim Strt As Long
   
   For Each Cl In Range("A2", Range("A" & Rows.Count).End(xlUp))
      Strt = InStr(1, Cl, "(")
      If Strt > 0 Then Cl.Characters(Strt, Len(Cl)).Font.Color = vbWhite
   Next Cl
End Sub
 
Upvote 0
Ok, how about
Code:
Sub KerryNewman()
   Dim Cl As Range
   Dim Strt As Long
   
   For Each Cl In Range("A2", Range("A" & Rows.Count).End(xlUp))
      Strt = InStr(1, Cl, "(")
      If Strt > 0 Then Cl.Characters(Strt, Len(Cl)).Font.Color = vbWhite
   Next Cl
End Sub

Perfect, Thanks Fluff!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,198
Members
453,022
Latest member
RobertV1609

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