The variable MyInactiveSht is determined by a Listbox on a UserForm
doesn't work because Address doesn’t work on an inactive sheetPlease Login or Register to view this content.
how can I obtain that cell address?
The variable MyInactiveSht is determined by a Listbox on a UserForm
doesn't work because Address doesn’t work on an inactive sheetPlease Login or Register to view this content.
how can I obtain that cell address?
Hello Carstowal,
Since your syntax is correct, I am assuming your problem is with the worksheet name. If you have declared the name as a Public string in a VBA Module, it is visible to all components in the VBA Project as long as the code is running. If you are trying to retrieve the worksheet name from the ListBox on the UserForm then the UserForm must be Loaded for the code below to work. Change the name of the ListBox to match yours.
Sincerely,Please Login or Register to view this content.
Leith Ross
Hi,
Set ScreenUpdating = False, obtain the current sheet name, activate the Inactive sheet, your code, activate the "current sheet name" ???
HTH
You don't need to activate the sheet. This will work whatever sheet is active. Just edit how you get the sheet name.
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Thanks Roy,
I must admit I was puzzled by this since as you rightly say you don't need sheets or objects to be selected before working with them. However try as I might on my Mac with Excel 2004 for Mac, I could not get this sort of code to work when I was testing it. I've even used your exact example and it just returns the address of the last cell on the Active sheet.
I'll have to put it down to another frustrating difference between Windows and OSX versions of Excel. Maybe we should have a forum or at least a FAQ for Mac/Windows differences
Regards,
Richard
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks