+ Reply to Thread
Results 1 to 5 of 5

Worksheet Coding

  1. #1
    Registered User
    Join Date
    06-13-2005
    Posts
    43

    Worksheet Coding

    Just trying to broaden my Excel knowledge and while looking around i noticed you can add Coding to an actual worksheet through the tab at the bottom.

    Can you please explain wat this would be used for and please give me some examples of wat you could use this for please.

    Thank you

  2. #2
    Norman Jones
    Guest

    Re: Worksheet Coding

    Hi XCESIV,

    Normally, a worksheet module is used to house worksheet event procedures.

    For more information on event procedures, see Chip Pearson at:

    http://www.cpearson.com/excel/events.htm

    If you perform a Google Groups search on any of the worksheet events, you
    will find many code examples.


    ---
    Regards,
    Norman



    "XCESIV" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Just trying to broaden my Excel knowledge and while looking around i
    > noticed you can add Coding to an actual worksheet through the tab at
    > the bottom.
    >
    > Can you please explain wat this would be used for and please give me
    > some examples of wat you could use this for please.
    >
    > Thank you
    >
    >
    > --
    > XCESIV
    > ------------------------------------------------------------------------
    > XCESIV's Profile:
    > http://www.excelforum.com/member.php...o&userid=24271
    > View this thread: http://www.excelforum.com/showthread...hreadid=544936
    >




  3. #3
    Tom Ogilvy
    Guest

    Re: Worksheet Coding

    You would use it for (and it should be reserved for) events related to the
    worksheet.

    http://www.cpearson.com/excel/events.htm for an overview

    --
    Regards,
    Tom Ogilvy

    "XCESIV" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Just trying to broaden my Excel knowledge and while looking around i
    > noticed you can add Coding to an actual worksheet through the tab at
    > the bottom.
    >
    > Can you please explain wat this would be used for and please give me
    > some examples of wat you could use this for please.
    >
    > Thank you
    >
    >
    > --
    > XCESIV
    > ------------------------------------------------------------------------
    > XCESIV's Profile:

    http://www.excelforum.com/member.php...o&userid=24271
    > View this thread: http://www.excelforum.com/showthread...hreadid=544936
    >




  4. #4
    Registered User
    Join Date
    06-13-2005
    Posts
    43
    So should all the macros that are specific for that work sheet be setup in there or wat

    Can u please give me some examples.

    ty

  5. #5
    Tom Ogilvy
    Guest

    Re: Worksheet Coding

    No. Only macros that are triggered by the events of that worksheet. When
    you open that module, then at the top of it, you will see two dropdowns. the
    left dropdown will have worksheet in it. If you have activeX controls on the
    worksheet, it will also contain the control names. So select worksheet or
    one of the controls. then in the right dropdown at the top, you will have
    the events associated with the item selected in the left dropdown. such as
    for a commmand button, you would have the Click Event as an example. If you
    selected Click, it would deposit the event declaration in the module

    Private Sub CommandButton1_Click()

    End Sub

    you could then add code to this event. If you can not select the event from
    the dropdowns prior to putting it in the module, then it probably shouldn't
    be located in this module.

    Also, entering the declaration this way insures you have the proper
    arguments if any.

    for an example

    Private Sub CommandButton1_Click()
    msgbox "You clicked Commandbutton1"
    End sub



    --
    Regards,
    Tom Ogilvy




    "XCESIV" wrote:

    >
    > So should all the macros that are specific for that work sheet be setup
    > in there or wat
    >
    > Can u please give me some examples.
    >
    > ty
    >
    >
    > --
    > XCESIV
    > ------------------------------------------------------------------------
    > XCESIV's Profile: http://www.excelforum.com/member.php...o&userid=24271
    > View this thread: http://www.excelforum.com/showthread...hreadid=544936
    >
    >


+ 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