+ Reply to Thread
Results 1 to 3 of 3

Worksheet vs. General modules

  1. #1
    Registered User
    Join Date
    03-12-2009
    Location
    Tampa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Worksheet vs. General modules

    Hi!

    What is the difference between Worksheet and General?

    Why does my code need to be in Worksheet in order to work?

    I cannot seem to add more than one "Sub" to a worksheet, it automatically sends it to General.

    Thanks.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Worksheet vs. General

    For info on the different types of Worksheet events type the below in help

    Worksheet Object Events
    You can only use one type e.g only one
    Worksheet_Change
    event for example.

    Sub modules should really go in it's own module. You can add a module under the menu Insert module

    You can only place code in ThisWorkbook

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: Worksheet vs. General modules

    Why does my code need to be in Worksheet in order to work?
    Very hard to tell without seeing your code. But here are a few reasons;
    - referencing something that is local to the worksheet, such as a control
    - using the ME reference object
    - using event code
    Cheers
    Andy
    www.andypope.info

+ 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