+ Reply to Thread
Results 1 to 3 of 3

Load VBA on Activated Sheet

  1. #1
    RigasMinho
    Guest

    Load VBA on Activated Sheet

    Hey,
    in Visual basic you can put in code to run when the form is loaded up.

    is there a way to do the same for Excel when a worksheet is loaded up?


  2. #2
    Jim Thomlinson
    Guest

    RE: Load VBA on Activated Sheet

    What you are looking for is event driven programming and the answer is yes.
    On the worksheet you want to run the code... Right Click the Tab and select
    View Code. Just above the code window in the left had drop down box (General)
    select Worksheet. the drop down on the Right will give you all of the Events
    you can program against. You are looking for Activate. When you select the
    event a code stub will be added for you...
    --
    HTH...

    Jim Thomlinson


    "RigasMinho" wrote:

    > Hey,
    > in Visual basic you can put in code to run when the form is loaded up.
    >
    > is there a way to do the same for Excel when a worksheet is loaded up?
    >
    >


  3. #3
    Bob Phillips
    Guest

    Re: Load VBA on Activated Sheet

    Private Sub Worksheet_Activate()
    'do something
    End Sub

    'This is worksheet event code, which means that it needs to be
    'placed in the appropriate worksheet code module, not a standard
    'code module. To do this, right-click on the sheet tab, select
    'the View Code option from the menu, and paste the code in.


    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "RigasMinho" <[email protected]> wrote in message
    news:[email protected]...
    > Hey,
    > in Visual basic you can put in code to run when the form is loaded up.
    >
    > is there a way to do the same for Excel when a worksheet is loaded up?
    >




+ 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