I wish to find a word in excel and highlight that cell.How to do it using VBA. My code is highlighting the entire sheet.
Here is the code-
Sub Foreign_Lang_Converter()
Sheets("Sheet2").Select
Value = 0
i = 1
Do While (Cells(i, 2) <> "")
Value = Value + 1
i = i + 1
Loop
Count = 0
For j = 1 To Value
a = Cells(j, 1)
b = Cells(j, 2)
Sheets("Sheet1").Select
Cells.Select
Selection.Find What:=a
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
Selection.Replace What:=a, Replacement:=b
Sheets("Sheet2").Select
Next j
End Sub