I know just little enough about building macros in Excel with VB to be dangerous and currently have the following situation.
I've created a macro for use with log files that generally contain the same information. The macro was recorded using the Ctrl+F action to find text string 1, go to the cell containing text string 1, copy the entire contents of the cell, paste it in a new cell at the top of the page in certain cell and then move on to find text string 2, go to the cell containing text string 2, copy the entire contents... you get the picture. It works like a charm except that if it can find text strings 1, 2 and 3 but then text string 4 isn't in the spreadsheet, it stops and spits up an error.
My question: what can I add to the code to get the macro to do something along the lines of "find text string 4... if you find it, go to the cell containing text string 4, copy the entire contents of the cell, paste it in a new cell at the top of the page then move on OR if you don't find text string 4, move along to text string 5"?
Here's an example of the section of the code involving this action:
[Cells.Find(What:="total jobs created", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Selection.Copy
Range("D7").Select
ActiveSheet.Paste
Cells.Find(What:="total jobs in xml", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Selection.Copy
Range("D8").Select
ActiveSheet.Paste]
All help is greatly appreciated! Thanks in advance!