+ Reply to Thread
Results 1 to 3 of 3

Thread: how can i call a sub() automatically when someone click on sheet1

  1. #1
    Saadi
    Guest

    how can i call a sub() automatically when someone click on sheet1

    Hi

    I have a function, that is to be called when someone click on the sheet1.
    can someone tell me how do I do this.

    the name of that sub is FindRelatedVal()

    Sub FindRelatedVal()
    ............................
    End Sub

  2. #2
    Jimbola
    Guest

    RE: how can i call a sub() automatically when someone click on sheet1

    You can attach the function (macro) to the activate worksheet event for sheet
    one.
    In the visual basic editor click sheet1 on the left explorere window, then
    in the code window on the right where the drop down list says declaration
    change that to This Workbook, then on the right dropdown lists select
    Activate.
    Add your code and it should run when you click sheet1.

    HTH

    "Saadi" wrote:

    > Hi
    >
    > I have a function, that is to be called when someone click on the sheet1.
    > can someone tell me how do I do this.
    >
    > the name of that sub is FindRelatedVal()
    >
    > Sub FindRelatedVal()
    > ............................
    > End Sub


  3. #3
    Saadi
    Guest

    RE: how can i call a sub() automatically when someone click on she

    It Worked thanks Jimbola.

    "Jimbola" wrote:

    > You can attach the function (macro) to the activate worksheet event for sheet
    > one.
    > In the visual basic editor click sheet1 on the left explorere window, then
    > in the code window on the right where the drop down list says declaration
    > change that to This Workbook, then on the right dropdown lists select
    > Activate.
    > Add your code and it should run when you click sheet1.
    >
    > HTH
    >
    > "Saadi" wrote:
    >
    > > Hi
    > >
    > > I have a function, that is to be called when someone click on the sheet1.
    > > can someone tell me how do I do this.
    > >
    > > the name of that sub is FindRelatedVal()
    > >
    > > Sub FindRelatedVal()
    > > ............................
    > > End Sub


+ 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.2.0