VB expression for last sheet of workbook

may i ask what is the VB expression for → last sheet in excel file or workbook?

trying to do a find last data in last sheet but i don’t wish to have to keep changing last sheet name manually.

image

@Jarvius - Just to double check…are you trying this in Studio or StudioX?

If StudioX…you can try this way…first get the total sheet count…

My Input file has 5 sheets…

Step 2: You can use this total sheet count in the If activity to check as shown below…Here is have showed you, I am inside Sheet5…now you can add your process inside this…

Hope this helps…

hi thanks a million for the quick reply.

• not sure why but SheetIndex caused an error (could be because my file is pw protected)

• hence i changed it to save for later use and it works

1 Like

@Jarvius - Not sure of the error. Even I renamed it after using default save for later.

if your issue is solved , once you are done with your testing please mark my post as solution so that others will be benefited.

Thanks…

the only catch is if a file has 20 tabs it cycles through all the tabs manually (though speedily) - i tried to solve this by hiding earlier tabs to shorten it to like 2~3 tabs - but the automation still cycles through the tabs in the background

would be good if there could be a “jump to last tab” not “cycle to last tab” solution.

sorry for my greediness :grin:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.