Hi All,
I have a macro that matches debits and credits in a column and then makes it bold, I was wondering if I can tweak this code to also highlight it as well as bold
I have a macro that matches debits and credits in a column and then makes it bold, I was wondering if I can tweak this code to also highlight it as well as bold
Code:
Sub ModifyFindMatch()
Dim myVar
Dim x As Integer
Dim y As Integer
Dim mycell
ActiveSheet.Range("u23").Select
y = ActiveSheet.Range("u23").End(xlDown).Row - ActiveCell.Row
Do Until IsEmpty(ActiveCell)
myVar = ActiveCell
For i = 1 To y
If ActiveCell.Offset(i).Value = -1 * myVar Then
Set mycell = ActiveCell.Offset(i)
If mycell.Font.FontStyle <> "Bold" Then
mycell.Font.FontStyle = "Bold"
ActiveCell.Font.FontStyle = "Bold"
Exit For
End If
End If
Next i
ActiveCell.Offset(1).Select
Loop
End Sub