Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Unanswered: Global Variables in Excel

    Hi peeps, I have 2 problems, if you can answer eiehtr thats cool!

    Is it possible to crete a global variable constant that can be accessed by other sheets in the excel program. How can this be done?
    i.e. i declare in a module and the sheet accesses the value pie from the module and displays it in a cell in a sheet

    2/Also is it possible to create an executable .EXE file from Excel so that the user can open up the program and and not have the design view?

    Thx

  2. #2
    Join Date
    Dec 2003
    Location
    San Diego, CA
    Posts
    153
    Welcome to the Board!

    To declare a variable globally, at the top of any module, put "Public X As Whatever", String, Object, etc.

    In your sheet module, set X = Whatever then your Cell Range = X. If you want to call the variable from the sheet and not from VBA, you'd need to write a Uder Defined Function (UDF).

    As for the second part, No. But you get download the free Excel Viewer from Microsoft. It's esssentially a non-functional version of Excel. But it won't do you any good if your users already have Excel.

    Understanding that Excel is not a secure environment, you can do a lot with worksheet/workbook protection that the average user will never be able to get around. Just understand that someone who wants in can.

    Hope that helps,

    Smitty

  3. #3
    Join Date
    Mar 2004
    Posts
    4
    Hey, I tried out what you sed, and it didnt work for some reason. I have sent you the file with my attempt and could you correct it so the value of x i set it in the module is displayed in sheet1.
    thx agen

Posting Permissions

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