Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I save variable when 'end'? The user then reactivates the
I auto_open a macro, set variables then exit the mcro to allow users to
directly enter values in the worksheet. When they are through they press a button that reactivates the aarco. My problem is the variablest that I have set are lost. Is there a way to save these variables. I currently save then in portion of a work sheet the user does not see. I would like a better way. thanks for the help OlieH |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I save variable when 'end'? The user then reactivates the
Olie
I always save to a hidden sheet, it seems the easiest way. I you do not want the user to see the sheet you can set it to Very Hidden with VB so the user wil not see the sheet in the list of hidden sheets. You will have to unhide the sheet again using a macro. Regards Peter Atherton "OlieH" wrote: I auto_open a macro, set variables then exit the mcro to allow users to directly enter values in the worksheet. When they are through they press a button that reactivates the aarco. My problem is the variablest that I have set are lost. Is there a way to save these variables. I currently save then in portion of a work sheet the user does not see. I would like a better way. thanks for the help OlieH |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I save variable when 'end'? The user then reactivates
Thanks for the reply Peter/Billy.
"Billy Liddel" wrote: Olie I always save to a hidden sheet, it seems the easiest way. I you do not want the user to see the sheet you can set it to Very Hidden with VB so the user wil not see the sheet in the list of hidden sheets. You will have to unhide the sheet again using a macro. Regards Peter Atherton "OlieH" wrote: I auto_open a macro, set variables then exit the mcro to allow users to directly enter values in the worksheet. When they are through they press a button that reactivates the aarco. My problem is the variablest that I have set are lost. Is there a way to save these variables. I currently save then in portion of a work sheet the user does not see. I would like a better way. thanks for the help OlieH |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I save variable when 'end'? The user then reactivates the
I think you should rewrite your code so that you don't use that End statement
(not end with, not end if--just the plain old End). Then your static variables will still hold their values. On the other hand, lots of things can go wrong. I would include a routine that would repopulate those variables. Add one more public/static variable: Public VariablesAreInitialized as boolean Then later you can use: if variablesareinitialized then 'keep going else call dedicatedroutinetoinitializevariables 'not rely on Auto_open end if sub dedicatedroutinetoinitializevariables() set TWB = somethingoranother ...all you need variablesareinitialized = true end sub just in case something unexpected goes wrong. (or if twb is nothing then call dedicatedroutinetoinitializevariables end if OlieH wrote: I auto_open a macro, set variables then exit the mcro to allow users to directly enter values in the worksheet. When they are through they press a button that reactivates the aarco. My problem is the variablest that I have set are lost. Is there a way to save these variables. I currently save then in portion of a work sheet the user does not see. I would like a better way. thanks for the help OlieH -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there some 'secret' to getting 'End' to work when stopping func | Excel Worksheet Functions | |||
How do I remove the 'end' function in Excel 2003? | Excel Worksheet Functions | |||
Save button, VBA protected, allow user to define where to save | Excel Programming | |||
prompt user to save file as {desired_name} and save it to a variab | Excel Programming | |||
VSB code - 'Home' & 'CTRL+End' | Excel Discussion (Misc queries) |