Declaring Variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • apank
    New Member
    • Sep 2008
    • 31

    Declaring Variables

    I am new to VBA, and just getting my feet wet. Do you need to declare anything if you are simply having your code kick off a bunch of comands such as runqueries and transfertexts?
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32653

    #2
    Not unless you use any variables.

    I would always use Option Explicit in ANY module you ever create though. The default is not to have it, but that is so WRONG and ultimately very unhelpful to you, the developer.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32653

      #3
      To ensure the default is changed for all new modules select "Require Variable Declaration" from Tools / Options in the VBA Editor (Editor tab).

      Comment

      • apank
        New Member
        • Sep 2008
        • 31

        #4
        Thank you very much. That is helpful. Have a good one.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32653

          #5
          No worries - You too.

          And welcome to Bytes!

          Comment

          Working...