+ Reply to Thread
Results 1 to 2 of 2

why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel?

  1. #1
    Daniel
    Guest

    why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel?

    why is it saying sheetcnt is "variable not defined" how to do a global
    variable to share over multiple functions in vba for excel?

    Dim sheetcnt As Integer
    Private Sub cmdImport_Click()
    sheetcnt = 1



  2. #2
    Earl Kiosterud
    Guest

    Re: why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel?

    Daniel,

    Dimming a variable outside the procs makes it module-level. If you'll need
    to use it across modules, make it project level:

    Public sheetcnt As Integer

    --
    Earl Kiosterud
    www.smokeylake.com/
    -------------------------------------------

    "Daniel" <[email protected]> wrote in message
    news:%[email protected]...
    > why is it saying sheetcnt is "variable not defined" how to do a global
    > variable to share over multiple functions in vba for excel?
    >
    > Dim sheetcnt As Integer
    > Private Sub cmdImport_Click()
    > sheetcnt = 1
    >
    >




+ 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