JDerrico
07-28-2006, 02:59 PM
Good evening,
I'm new here and I know just enough Excel VBA to get by.
However, I'm stumped with this. Any and all help would be greatly appreciated and I thank you in advance for your help.
What I would like to do is, find the first Blue (color 41) cell using the Find function in Excel. I can do that and it works fine, but I wanted to have it done in a macro.
Here's the code that Excel created:
Sub OL_Find_BlueFormat1()
'
' OL_Find_BlueFormat1 Macro
' Macro recorded 7/27/2006 by Jay D.
'
'
Range("B5").Select
With Application.FindFormat.Interior
.ColorIndex = 41
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=True).Activate
ActiveCell.Offset(-1, 0).Range("A1:AB1").Select
Range(Selection, Selection.End(xlUp)).Select
End Sub
The problem is that it gets stuck on this part when I rerun the macro.
Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=True).Activate
Any ideas how to fix this?
Thanks, Jay
I'm new here and I know just enough Excel VBA to get by.
However, I'm stumped with this. Any and all help would be greatly appreciated and I thank you in advance for your help.
What I would like to do is, find the first Blue (color 41) cell using the Find function in Excel. I can do that and it works fine, but I wanted to have it done in a macro.
Here's the code that Excel created:
Sub OL_Find_BlueFormat1()
'
' OL_Find_BlueFormat1 Macro
' Macro recorded 7/27/2006 by Jay D.
'
'
Range("B5").Select
With Application.FindFormat.Interior
.ColorIndex = 41
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=True).Activate
ActiveCell.Offset(-1, 0).Range("A1:AB1").Select
Range(Selection, Selection.End(xlUp)).Select
End Sub
The problem is that it gets stuck on this part when I rerun the macro.
Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=True).Activate
Any ideas how to fix this?
Thanks, Jay