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
AR:Central IL (Johns, Andrew)
AR:MS South (Luther, Susan)
AR:Chicago, IL (Martinez, Ben)
AR:Memphis, TN (Glaser, Albert)
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

<colgroup><col></colgroup><tbody>
</tbody>
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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,213,494
Messages
6,113,974
Members
448,537
Latest member
Et_Cetera

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