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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
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,940
Messages
6,122,356
Members
449,080
Latest member
Armadillos

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