+ Reply to Thread
Results 1 to 3 of 3

Vba code to run when we click on a specify sheet in the workbook

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Vba code to run when we click on a specify sheet in the workbook

    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

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Vba code to run when we click on a specify sheet in the workbook

    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.

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Vba code to run when we click on a specify sheet in the workbook

    Alternatively you can set this globally in ThisWorkbook:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1