I am relatively new to VBA and came across this error for a segment of code I have been working on - it worked when I recorded the macro but not when I run it, and I know that there are definitely cells available of the format that I am looking for, but I just wondered if anyone could point me in the right direction?
I am trying to find the first occurrence of a cell with a particular colour background, regardless of the text within the cell, and what I have so far (from recording a macro, then updating it slightly) is the following:
Thanks in advance!Sheets("KPI (2)").Visible = True
Sheets("KPI (2)").Select
Range("A1").Select
With Application.FindFormat.Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent2
.TintAndShade = 0.599963377788629
.PatternTintAndShade = 0
End With
Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=True).Activate
Bookmarks