guilhermelemos
New Member
- Joined
- Oct 7, 2013
- Messages
- 11
Hi,
I am working on a longer macro, which will fill some fields depending on a few data sources.
Where I am stuck is when the code looks for some information in a report, but doesn't find (that is expected in a significant number of instances).
I need the macro to tell me (actually to take action, re-start a loop based on slightly different info) when that initial information the code was looking for cannot be found.
The relevant section of the code:
Application.Goto ActiveWorkbook.Sheets("Inventory").Cells(1, 1)
Set Found = Sheets("Inventory").Cells.Find(What:=k, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False).Activate
When the find function is successful, the code leaves me at the cell where the content was found. When the content is not found, it just doesn't go anywhere and no "alert" is generated.
Thanks in advance.
I am working on a longer macro, which will fill some fields depending on a few data sources.
Where I am stuck is when the code looks for some information in a report, but doesn't find (that is expected in a significant number of instances).
I need the macro to tell me (actually to take action, re-start a loop based on slightly different info) when that initial information the code was looking for cannot be found.
The relevant section of the code:
Application.Goto ActiveWorkbook.Sheets("Inventory").Cells(1, 1)
Set Found = Sheets("Inventory").Cells.Find(What:=k, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False).Activate
When the find function is successful, the code leaves me at the cell where the content was found. When the content is not found, it just doesn't go anywhere and no "alert" is generated.
Thanks in advance.