Hi again,
Thank you for that feedback.
One VERY important point!
will activate whichever worksheet has the VBA CodeName of "sheet3",
whereas
will create a reference to whichever worksheet happens to be associated with the third tab of the workbook.
From a code point of view, the VBA CodeName of a worksheet is MUCH more "robust" than its TabName or its position within the workbook - VBA CodeNames are very unlikely to be changed by Users, but Users can quite easily alter the order of the worksheets or their TabNames if the workbook structure is not password-protected.
More significantly, in the absence of further information, it would appear that the code you've just posted can be omitted. If the CommandButton which displays the UserForm is located on the worksheet you want to display "underneath/behind" the UserForm, that worksheet will, by definition, be the active worksheet when the UserForm is displayed.
Hope you find this useful/interesting.
Regards,
Greg M
P. S. Many thanks for the Reputation increase - much appreciated!
Bookmarks