Hi All,
I am a newbie on macro's and still learning . Hope you can help me out. I have a working sendkeys macro. Accept for one part that I can't figure out; ErrHandler1.
Problem: No search result error from notepad if text is not present in notepad file
Solution looking for: if no result, Close pop-up, and start macro from start again with the next value
Preciate all the help i can get
Kind regards
I am a newbie on macro's and still learning . Hope you can help me out. I have a working sendkeys macro. Accept for one part that I can't figure out; ErrHandler1.
Problem: No search result error from notepad if text is not present in notepad file
Solution looking for: if no result, Close pop-up, and start macro from start again with the next value
Preciate all the help i can get
Kind regards
Code:
Sub RemoveRow()
Sheets("Test").Select
StartMacro:
On Error GoTo ErrHandler1
Do While (Selection.Offset(0, 0) <> "")
If ActiveCell.Value = "" Then Exit Sub
Selection.Copy
AppActivate "db_"
Application.Wait Now + TimeValue("00:00:01")
SendKeys "^f"
SendKeys "^v"
SendKeys "~"
SendKeys "{ESC}"
Application.Wait Now + TimeValue("00:00:01")
SendKeys "{HOME}"
SendKeys "+{DOWN}"
SendKeys "{DEL}"
Application.Wait Now + TimeValue("00:00:01")
SendKeys "^f"
SendKeys "Contr.rek."
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{UP}"
SendKeys "~"
Application.Wait Now + TimeValue("00:00:01")
SendKeys "{ESC}"
SendKeys "{HOME}"
Application.Wait Now + TimeValue("00:00:01")
AppActivate "LSMW"
Selection.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "OK"
Application.CutCopyMode = False
Selection.Offset(0, -1).Select
Selection.Offset(1, 0).Select
Loop
Exit Sub
ErrHandler1:
Resume StartMacro
End Sub