Hi guys
I want to run the vba code when the user click on a specific sheet in workbook. Can anyone tell me how to start doing it?
Thanks
Hi guys
I want to run the vba code when the user click on a specific sheet in workbook. Can anyone tell me how to start doing it?
Thanks
hi
right click on the tab for that sheet and select "view code"
in the drop down menu on the top left, select "worksheet"
in the drop down menu adjacent to it on the right is a list of events that can happen to that sheet which will trigger a macro
for example, you can have a macro that runs when the sheet is selected or changed.
So, to display a message "hi" every time the sheet is activated, your code is:
![]()
Please Login or Register to view this content.
Alternatively you can set this globally in ThisWorkbook:
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks