If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Global Variables in Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-25-04, 11:34
jaime1985 jaime1985 is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
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
Reply With Quote
  #2 (permalink)  
Old 03-25-04, 11:51
Smitty Smitty is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 03-25-04, 16:19
jaime1985 jaime1985 is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On