Hi all
I'm trying to teach myself VBA and am trying to build a really simple programme which looks at a range of text data from cell A1 to cell E10, and if the text says 'fraud' then the cell will be highlighted a certain colour.
The code I have written is a mash up from various sources on the internet and I have no idea whether it's suitable or not. I keep getting the error "End if without Block If" which I understand to mean my 'If' instruction is not correct.
Here is my code, could someone please advise me?
Sub Test()
'
' Test Macro
'
Dim Rownumber As Integer
Dim rng As Range, cell As Range
Set rng = Range("A1:E10")
For Each cell In rng
If cell.Value = "Fraud" Then cell.Interior.ColorIndex = 60
End If
End Sub
Bookmarks