Hello,
Within VBA I want to get access to the data in ranges on hidden sheets. Is this possible while keeping these sheets hidden?
Best regards,
g
Hello,
Within VBA I want to get access to the data in ranges on hidden sheets. Is this possible while keeping these sheets hidden?
Best regards,
g
Yes
In the ame way that you get data from any sheet. Just because it is hidden does not mean you can not work with it.
You do not need to activate or select books, sheets, rows, columns, cells etc to work with them
![]()
Please Login or Register to view this content.
Please Read Forum Rules Before Posting
Wrap VBA code by selecting the code and clicking the # icon or Read This
How To Cross Post politely
Top Excel links for beginners to Experts
If you are pleased with a member's answer then use the Scales icon to rate it
If my reply has assistedor failed to assist you
I welcome your Feedback.
Mudraker,
Extracting a cell value from a hidden workbook with VB code could be very useful! What would be the syntax for [the workbook] in the string below?
ActiveSheet.Range("A1") = [the workbook]Sheets("Sheet1").Range("A1")
Thanks!
Just add the workbooks(???) before sheets(???)
Remember that until a book is saved it does not have .xls as part of its name
You cann also use a variable to refer to a book by name. Replace "book1.xls" with the variable name - no " required![]()
Please Login or Register to view this content.
or you can set a variable to become a book or a sheet
![]()
Please Login or Register to view this content.
Thanks. The attached example might make things clearer. I want to read the first cell in the range myRange on Sheet2. Sheet2 is made hidden at the start of the test sub.
Thanks much!
g
mudraker:
Understood!
Thanks again,
g
g,
Please excuse the encroachment.
Mudraker,
That's great info. It appears to work in the reverse as well...it writes to the hidden workbook w/o messing with screenupdating, etc.
I probably could have saved 10MB of my 40MB, 29 worksheet "program" (THE INTERPRETER) had I known more tricks!
See my stuff at http://www.e-linq.com/New_ElinQ/index.php (soon to be published)
Can you also tell me if there is a way in Excel VB to check if a specified Excel file exist in my web?
As far as I can see, the Dir Function will only work with local files...but maybe I haven't hit on the proper syntax of the string.
Thanks!
gstremer
Have you resolved your problem or do you still need more assistance?
ern2ern
You can do most things in VBA without selecting or activating workbooks, sheets, rows, ranges, cells, objects by following similar programming techniques.
Re your Webfile query I seen you post on that yesterday. I could not answer it yesterday & I still can't answer it today in a way that will assist you.
mudraker:
yes, my problem is solved. removed selections from the code.
g
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks