gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I have code to clear a named range. It works great if there is data in the range. But if the range is empty, I get an error.
I want to check to see if the named range has data before I run code (if that's the smart way).
Help Please. Not sure how to check or if I should stop macro if error
I want to check to see if the named range has data before I run code (if that's the smart way).
Help Please. Not sure how to check or if I should stop macro if error
Code:
Sub ClearPBOMTable()
Worksheets("PBOM").ListObjects("tblPBOM").DataBodyRange.Delete
End Sub