Quote:
|
Originally Posted by DavidCoutts
why did you set x as an object in your code rather than a worksheet, I know it doesn't matter for code execution but is there any reason you did this? Just satisfying my curiosity 
|
This is a canned function that I use as needed in various projects. Using the general 'Object' Type allows you to swap out any object in the 'Set' statement to make a new function to test for existance; Range, Workbook, etc. I originally found this function in the book
Excel Power Programming Techniques You can find this example and
other usefull functions on the Spreadheet page website.
worksheet is not actually a "defined" supported data type, that is if you go by the excel documentation. You can find a Table of Data types by looking up "
Data Type Summary" in the Excel
VB Help. 'Worksheet' is a member of the 'Object' Type classification, so using it will only make you're code more specific and less forgiving.