I have a spreadsheet with the months jan-dec and I want to open the tab based on a certain month. If the month have data already in certain cells, I want to loop through this and go to the next tab.
I have a spreadsheet with the months jan-dec and I want to open the tab based on a certain month. If the month have data already in certain cells, I want to loop through this and go to the next tab.
Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.
Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.
To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.
It's not clear how many cells you have to check in each tab, or whether there has to be a specific values in each cell or if ANY value will suffice.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
Hi sony,
In VBA most things have "index" and "Count".
In the immediate window you can type "debug.print Worksheets.Count" and press enter to find how many tabs you have.
Note "Debug.Print" can be shortened to "?"
You can use the Worksheet(index) to find the name of the worksheet like using, in the immediate window.
"?Worksheets(2).name" and press enter. This shows "Sheet2" for me.
To loop through each worksheet name something like:
Hope this helps.Please Login or Register to view this content.
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks