+ Reply to Thread
Results 1 to 2 of 2

Difference among Module, SheetX, ThisWorkbook?

Hybrid View

  1. #1
    muster
    Guest

    Difference among Module, SheetX, ThisWorkbook?

    Hi,

    Have been using VBA for a while but I only write code in modules,
    wondering what's the difference among them.

    Is code in Sheet1 only effective for sheet 1 or is it Worksheet level
    function, etc.?

    Thanks,


  2. #2
    Bob Phillips
    Guest

    Re: Difference among Module, SheetX, ThisWorkbook?

    Code in worksheet1 tends to be event code that is driven by events on that
    sheet. You can add other code, but in general, it would only be for code
    associated with those events.

    Similarly, Thisworkbook handles workbook events.

    Standard modules tend to be where you would create the more general code, or
    even code that might be accessed by some event on more than one worksheet.

    --
    HTH

    Bob Phillips

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

    "muster" <muster@gmail.com> wrote in message
    news:1152294359.892083.288740@s53g2000cws.googlegroups.com...
    > Hi,
    >
    > Have been using VBA for a while but I only write code in modules,
    > wondering what's the difference among them.
    >
    > Is code in Sheet1 only effective for sheet 1 or is it Worksheet level
    > function, etc.?
    >
    > Thanks,
    >




+ 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