Consulting

Results 1 to 4 of 4

Thread: Dim

  1. #1
    VBAX Tutor
    Joined
    Dec 2008
    Posts
    244
    Location

    Dim

    I have a Module with many sub in it. Dim everything over when I'm working in a different sub?

    Thanks

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Public myVar As Long
    
    Sub abc()
        myVar=16
        Cal xyz
    End Sub
    
    Sub xyz()
        Msgbox myVar
    End SUb
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Dec 2008
    Posts
    244
    Location
    how do you do a global variable independent of sub?

    thanks

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    It was in the first line of xld's code:
    Public myVar as Long
    Public variables are stored at the top of any Module.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •