I have 2 worksheets (Worksheet 1 & Worksheet 2). I am trying to searching the characters in column A on Worksheet 1 and see if those characters exist in Column A on Worksheet 2. Please note that these characters are not fixed, so characters may be added, removed, or changed. If they exists in Worksheet 2, then I would bold the characters in Worksheet 1 to the corresponding cell.
Worksheet 1
Column A
Jack
James
Peter
Angel
Worksheet 2
Column A
Jack ate an apple.
Peter flies a kite.
Henry wakes up for work.
James went to school.
My approach to this so far is using For loops and if-else statements. I was thinking about using InStr to find the characters within those sentence in Worksheet 2.
Dim StartNum As Integer
Dim EndNum As Integer
Dim rng1 As Range
Dim rng2 As Range
EndNum =
For StartNum = 1 To EndNum
If rng1.Value = InStr(rng2.Value) Then _
rng1.font.Bold = True
End If
A simple macro would do the work for you. Suppose you have a Sheet with Names and another with Sentences. So here is a small code:
End Sub
HAPPY VBA CODING!!!
Select all of column A on worksheet 1 with A1 as the active cell. Choose Home ► Conditional Formatting ► New Rule* and when the **New Formatting Rule* dialog appears, choose Use a formula to determine which cells to format then supply the following in the Format values where this formula is true: text box.
Click Format and select Bold from the Font tab. Click OK once to accept the formatting and then OK again to create the new rule.
I added a few non-matching names to Worksheet 1 and topped up the formatting change with a bold blue font for these results.