auto.pilot
Well-known Member
- Joined
- Sep 27, 2007
- Messages
- 734
- Office Version
- 365
- Platform
- Windows
I have this small bit of code which is part of a much larger project. My 'source' book includes client names in column C. The code opens a workbook, then filters by a Client, copies the filtered data, then pastes it into the 'destination' book. The following line results in an error message when the client is not included in the source book.
I need some method to skip forward in the code, without the error message, which reads: Runtime error 1004: No cells were found.
Thanks in advance.
Jim
VBA Code:
ActiveSheet.Range("C3:AGC" & Last_C).AutoFilter Field:=1, Criteria1:=TheClient
Range("C3:AGP" & Last_C).Copy
I need some method to skip forward in the code, without the error message, which reads: Runtime error 1004: No cells were found.
Thanks in advance.
Jim