A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
How can the user click on a button on a sheet if that sheet is not the active sheet?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I have a macro for a sheet called as BEF , macro will run and interact with other worskheets also during macro execution . At the end of the macro execution, Another worksheet is activated always., How to ensure that always BEF is activated here,
Please do not tell me that use Wroksheets("BEF").Activate here as my BEF name is not same , it can take 4 diff names dpeneding on selection by user at the start of opening excel.
How to activate current sheet using VBA?
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
How can the user click on a button on a sheet if that sheet is not the active sheet?
Dear Sir,
Your code works just fine for all cases, but I am facing an issue here.
IF we do not click on the worksheet, and just press button, then above code will not understand.
How to activate the sheet when user has just put the cursor on that sheet at the last event and not even click on any cell in that particular worksheet?
Hoep you got my requirement .
Right now, logic remembers last active sheet as last cell clicked worksheet here , but i want it to remember last mouse cursor worksheet and activate that aprticulae sheet also
That depends on your CPU and on how many other processes are using CPU capacity.
In a quick test on my PC, activating a worksheet took about 0.5 ms = 500 µs
It will consume how much ina macro typically like microseconds?
At the beginning of the macro:
Dim wshCurrent As Worksheet
Set wshCurrent = ActiveSheet
At the end:
wshCurrent.Activate