Hi,
I have a really newbie question. What is the most consistent error-free "stable" way to refer to sheets and select or activate them? I have various macros that jump the workbook user across sheets.
Is it better, for example, to refer to a sheet as "Sheet1" or the sheet name (e.g. "HOME")? Is there a functional difference?
Is there something better to do for selecting or activating a worksheet or range than just writing:
I ask because I occasionally get the 1004 method of selection failure error message. My macro runs a bunch of code (adding protections, hiding things etc.) when the workbook is opened and macros are enabled. The very last thing it does is jump the user back to a home screen. The Debug highlights the sheet selection for this chunk of code:![]()
Please Login or Register to view this content.
I KNOW the code is not incorrect because it usually runs fine. I can't usually replicate the error but I need the error to never appear because users will get confused.![]()
Please Login or Register to view this content.
Any thoughts on why I get these errors sometimes and how to prevent them? Thank you so much in advance!!!
Bookmarks