Conditional Formatting Help

dpsypher

New Member
Joined
Mar 30, 2015
Messages
9
I have a column of data and would like to highlight the cells if the first 8 characters are a match. Any ideas on how to get this done?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
You can run a macro, something like this (adjust for column and specific characters):

Sub Format()

'set length

Range("A2").Select
Dim length As Integer
length = ActiveSheet.UsedRange.Rows.Count

'highlight cells with ABCDEFGH as first eight characters

Dim i As Integer
Dim myString As String
For i = 2 To length
Range("A" & i).Select
myString = Selection
myString = Left(myString, 8)
If myString = "ABCDEFGH" Then
Selection.Interior.ColorIndex = 3
End If
Next i

End Sub
 
Last edited:
Upvote 0
You can use conditional formatting in Excel.

Select your column and open Home -> Conditional Formatting and add a new rule.
In "Format only cells that contain" option, select "Specific text" in first drop-down, "Beginning with" in second drop-down, and enter your 8 character string in third field. Then click on Format button and choose formatting options.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,042
Members
449,063
Latest member
ak94

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