+ Reply to Thread
Results 1 to 3 of 3

Accessing Global Variables in an Excel formula

  1. #1
    Registered User
    Join Date
    11-20-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Accessing Global Variables in an Excel formula

    Hi,

    I have the following Global Variable defined :

    Public MyVar as Integer


    I have set the value of this in a Macro.

    I now wish to access the value of this in a 'IF' statement e.g. if(MyVar=10, 10, "Not 10")

    Is this possible? If so, what is the syntax within the IF statement?

    Many thanks.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Accessing Global Variables in an Excel formula

    Put it in a cell:


    Please Login or Register  to view this content.
    Gary's Student

  3. #3
    Registered User
    Join Date
    11-20-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Accessing Global Variables in an Excel formula

    That does exactly what I wanted. Thanks very much for your help.

+ 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