Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone explain how to assign a public variable to my whole workbook so that it is recognized by all sheets
I want my password as a variable so that I don't have to change it in one place verses all of my sheets Any help thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jason wrote:
Can someone explain how to assign a public variable to my whole workbook so that it is recognized by all sheets? I want my password as a variable so that I don't have to change it in one place verses all of my sheets. Any help thanks in advance. How are you storing it now ? because you could use a workbook name (possibly hidden to add one layer of security), but if all you want is a public variable, then put something like Public ThePassword As String at the top of one standard module. You can define it as a constant, like Public Const ThePassword As String = "123456" -- Regards, Juan Pablo González |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Jason" wrote in message
... Can someone explain how to assign a public variable to my whole workbook so that it is recognized by all sheets? I want my password as a variable so that I don't have to change it in one place verses all of my sheets. Try the following code at the top of your first module: The string variable "Password" should be visible throughout your project. OPTION EXPLICIT Public strPassword as String |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have various input boxes on different sheets prompting for password. So on each sheet for each input box it is listed as
I basically want to change all my passwords at once with another input box, so that is why I need a public variable defined for all sheets or workbook. I think what you wrote will work for what I have. Not much security needed either psw=Inputbox("Please Enter Password" if psw = "MyPassword" the my cod end i ----- Juan Pablo González wrote: ---- Jason wrote Can someone explain how to assign a public variable to my whol workbook so that it is recognized by all sheets? I want my passwor as a variable so that I don't have to change it in one place verse all of my sheets Any help thanks in advance How are you storing it now ? because you could use a workbook name (possibl hidden to add one layer of security), but if all you want is a publi variable, then put something lik Public ThePassword As Strin at the top of one standard module You can define it as a constant, lik Public Const ThePassword As String = "123456 -- Regards Juan Pablo Gonzále |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to all who responded. I am learning quite a bit about VBA, but little things I am still finding out.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Set Public Variable on Open | Excel Discussion (Misc queries) | |||
Public variable | New Users to Excel | |||
Public/Procedure Variable | Excel Programming | |||
Scope of a public variable | Excel Programming | |||
public variable | Excel Programming |