Greg Truby
MrExcel MVP
- Joined
- Jun 19, 2002
- Messages
- 10,030
My question: I have been unable to locate any property of the SELECTION (or a RANGE) object that will allow me to test to see if the Selection/Range contains cells from multiple worksheets. Does anyone have any ideas?
Why I'm asking...
I have a number of utility-type macros that I have shared with others. I'm trying to make them more error resistant. For example I've already put in a line at the top of most to test that the user doesn't have a chart or shape selected:
If TypeName(Selection) <> "Range" Then BadSelectionMessage "DeleteDuplicateRows", TypeName(Selection)
-- BadSelectionMessage being a generic routine that tells the user of the error of his ways and uses and "END" statement to halt macro execution.
Thanks for any help anyone can offer.
Why I'm asking...
I have a number of utility-type macros that I have shared with others. I'm trying to make them more error resistant. For example I've already put in a line at the top of most to test that the user doesn't have a chart or shape selected:
If TypeName(Selection) <> "Range" Then BadSelectionMessage "DeleteDuplicateRows", TypeName(Selection)
-- BadSelectionMessage being a generic routine that tells the user of the error of his ways and uses and "END" statement to halt macro execution.
Thanks for any help anyone can offer.