I need a macro that will in my spreadsheet search for:
- In Colum B: find a cell that contains "H1 or H2 or H3 or H4"
- then when found, change the font to bold and underline in the text in Column A
CodePudding user response:
You should first answer these types of questions by using record macro.
CodePudding user response:
Dim LastRow As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
For I = 0 to LastRow
If Cells(I, 2).Value = "H2" OR If Cells(I, 2).Value = "H3" Then
Cells(I, 2).Font.Bold = True 'Probably doesnt work search the syntax
End If
Next I
There are mistake i think but the structure is something like this