Good morning,
when I run the code listed below it works perfect until I get to an empty cell then the Set Fnd area highlights yellow and I have to Debug. I've tried the If Fnd is Nothing then Exit sub (actually tried a variety of that) it just ignores it. I've also tried to use a message box as error handling in place of the If Fnd is Nothing but it tells me I have a For without Next. I've seen a variety of posts that are close to this problem and have tried to adapt them to mine but I either get the yellow highlights or missing Next. I have a feeling that I have just looked at this too long and the solution is right there in front of me. Another set of eyes would be greatly appreciated. Thanks
Sub Post()
Sheets("Worksheet_Issues").Select
Range("C2.C2500").Select
Set Fnd = Columns(1).Find(What:="Resolved", After:=ActiveCell, LookIn:=xlFormulas, _
Lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Fnd Is Nothing Then Exit Sub
ActiveCell.Offset(0, -2).Select
ActiveCell.Select
ActiveCell.Resize(, 13).Select
Selection.Copy
Application.CutCopyMode = True
Selection.Cut
Sheets("Deermine_Resolved").Select
ActiveSheet.Select
Range("A2:z2500").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveSheet.Paste
Sheets("Worksheet_Issues").Select
Next MyCell
End Sub
when I run the code listed below it works perfect until I get to an empty cell then the Set Fnd area highlights yellow and I have to Debug. I've tried the If Fnd is Nothing then Exit sub (actually tried a variety of that) it just ignores it. I've also tried to use a message box as error handling in place of the If Fnd is Nothing but it tells me I have a For without Next. I've seen a variety of posts that are close to this problem and have tried to adapt them to mine but I either get the yellow highlights or missing Next. I have a feeling that I have just looked at this too long and the solution is right there in front of me. Another set of eyes would be greatly appreciated. Thanks
Sub Post()
Sheets("Worksheet_Issues").Select
Range("C2.C2500").Select
Set Fnd = Columns(1).Find(What:="Resolved", After:=ActiveCell, LookIn:=xlFormulas, _
Lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Fnd Is Nothing Then Exit Sub
ActiveCell.Offset(0, -2).Select
ActiveCell.Select
ActiveCell.Resize(, 13).Select
Selection.Copy
Application.CutCopyMode = True
Selection.Cut
Sheets("Deermine_Resolved").Select
ActiveSheet.Select
Range("A2:z2500").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveSheet.Paste
Sheets("Worksheet_Issues").Select
Next MyCell
End Sub