Sample of my code:
sub findPInfo ()
With Sheet1.Range("A:A")
Set rFound = .Find(What:="Address:*", _
After:=.Cells(1, 1), LookIn:=xlValues, _
Lookat:=xlWhole, MatchCase:=False)
If rFound Is Nothing Then End With
rFound.Select
rFound.TextToColumns DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:=":", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
'rFound(1, 2).Select
rFound(1, 2).Copy Range("ZZ1")
End With
With Sheet1.Range("A:A")
Set rFound = .Find(What:="ward:*", _
After:=.Cells(1, 1), LookIn:=xlValues, _
Lookat:=xlWhole, MatchCase:=False)
If rFound Is Nothing Then End With
rFound.Select
rFound.TextToColumns DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:=":", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
'rFound(1, 2).Select
rFound(1, 2).Copy Range("ZZ2")
End With
End Sub
So the problem is that "If rFound Is Nothing Then End With" doesn't work. Am wondering can I say "Next with" or "GO TO Next With". What would be the right thing here.
Bookmarks