Results 1 to 3 of 3

[SOLVED] Trouble with module wide variable

Threaded View

saabman [SOLVED] Trouble with module... 03-10-2009, 05:16 AM
dominicb Re: Trouble with module wide... 03-10-2009, 05:26 AM
saabman Re: Trouble with module wide... 03-10-2009, 05:41 AM
  1. #1
    Registered User
    Join Date
    03-28-2007
    Posts
    6

    Question [SOLVED] Trouble with module wide variable

    Hi

    I am trying to get a module wide variable to provide the current filename to the various subs...

    Private CurrentFileName As String
    '-----------------------------------------------------------------------------------------
    Sub GetCurrentFileName()
    
    CurrentFileName = Cells("sFileName").Value
    MsgBox CurrentFileName
        
    End Sub 'GetCurrentFileName
    It seems I can't say the "CurrentFileName" be a cell value.
    why is this? I used the =CELL("fileneme") in the cell which I then gave a name to "sFileName". I get get the value if I declare the variable in the sub but not if it is declared at the beginning of the module...

    I am a bit of a beginner at this
    Thank you for any help you could provide
    Last edited by saabman; 03-10-2009 at 05:42 AM.

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