I have the below formula that highlights matching cells, but it also considers blank cells as mathing cells and highlights those as well and then labels those cash trades, which they arent.
[VBA]Sub Cashtrades()
Dim lr As Long, r As Long
Dim cell As Range
Dim str1 As String, str2 As String
ActiveWorkbook.Sheets(1).Activate
lr = Range("A65000").End(xlUp).Row
For Each cell In Range("A5:A" & lr)
r = cell.Row
If (StrComp(cell.Text, cell.Offset(0, 1).Text, vbTextCompare) = 0) Then
Range("A" & r & ":P" & r).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
Set del = cell
del.Offset(0, 16).FormulaR1C1 = "CASH TRADE"
End With
End If
Next cell
End Sub[/VBA]
Is there a way to have it only highlight and label cash trades when there are values in the cells, not just blank cells?