Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to stop the user and have the prompted to enter a password
before this macro button is run? I was this to only be an option for Administrative purposes only. Sheets("POLICY LIST").Select Rows("1:1").Select Selection.EntireRow.Hidden = False Rows("2:6").Select Selection.EntireRow.Hidden = True End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub Macro() Dim strPassword As String Do While Trim(strPassword) = "" strPassword = Trim(InputBox("Enter Password")) Loop Sheets("POLICY LIST").Select Rows("1:1").Select Selection.EntireRow.Hidden = False Rows("2:6").Select Selection.EntireRow.Hidden = True End Sub If this post helps click Yes --------------- Jacob Skaria "Munchkin" wrote: Is there a way to stop the user and have the prompted to enter a password before this macro button is run? I was this to only be an option for Administrative purposes only. Sheets("POLICY LIST").Select Rows("1:1").Select Selection.EntireRow.Hidden = False Rows("2:6").Select Selection.EntireRow.Hidden = True End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How & where do I specify what the password is? I tried entering the password
inside the quotation marks, but it didn't work. "Jacob Skaria" wrote: Sub Macro() Dim strPassword As String Do While Trim(strPassword) = "" strPassword = Trim(InputBox("Enter Password")) Loop Sheets("POLICY LIST").Select Rows("1:1").Select Selection.EntireRow.Hidden = False Rows("2:6").Select Selection.EntireRow.Hidden = True End Sub If this post helps click Yes --------------- Jacob Skaria "Munchkin" wrote: Is there a way to stop the user and have the prompted to enter a password before this macro button is run? I was this to only be an option for Administrative purposes only. Sheets("POLICY LIST").Select Rows("1:1").Select Selection.EntireRow.Hidden = False Rows("2:6").Select Selection.EntireRow.Hidden = True End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try the below...password is ........ mypassword
Sub Macro() Dim strPassword As String Do While Trim(strPassword) < "mypassword" strPassword = Trim(InputBox("Enter Password")) Loop Sheets("POLICY LIST").Select Rows("1:1").Select Selection.EntireRow.Hidden = False Rows("2:6").Select Selection.EntireRow.Hidden = True End Sub If this post helps click Yes --------------- Jacob Skaria "Munchkin" wrote: How & where do I specify what the password is? I tried entering the password inside the quotation marks, but it didn't work. "Jacob Skaria" wrote: Sub Macro() Dim strPassword As String Do While Trim(strPassword) = "" strPassword = Trim(InputBox("Enter Password")) Loop Sheets("POLICY LIST").Select Rows("1:1").Select Selection.EntireRow.Hidden = False Rows("2:6").Select Selection.EntireRow.Hidden = True End Sub If this post helps click Yes --------------- Jacob Skaria "Munchkin" wrote: Is there a way to stop the user and have the prompted to enter a password before this macro button is run? I was this to only be an option for Administrative purposes only. Sheets("POLICY LIST").Select Rows("1:1").Select Selection.EntireRow.Hidden = False Rows("2:6").Select Selection.EntireRow.Hidden = True End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It works! Thanks so much. Now - for another question. I tested it to see
what happens if you enter the wrong password and it seems to be stuck in limbo until you enter the correct password. How do I get the cancel button to end the macro? "Munchkin" wrote: Is there a way to stop the user and have the prompted to enter a password before this macro button is run? I was this to only be an option for Administrative purposes only. Sheets("POLICY LIST").Select Rows("1:1").Select Selection.EntireRow.Hidden = False Rows("2:6").Select Selection.EntireRow.Hidden = True End Sub |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim varPassword As Variant
varPassword = Trim(InputBox("Enter Password")) If Trim(varPassword) < "mypassword" Then Exit Sub If this post helps click Yes --------------- Jacob Skaria "Munchkin" wrote: It works! Thanks so much. Now - for another question. I tested it to see what happens if you enter the wrong password and it seems to be stuck in limbo until you enter the correct password. How do I get the cancel button to end the macro? "Munchkin" wrote: Is there a way to stop the user and have the prompted to enter a password before this macro button is run? I was this to only be an option for Administrative purposes only. Sheets("POLICY LIST").Select Rows("1:1").Select Selection.EntireRow.Hidden = False Rows("2:6").Select Selection.EntireRow.Hidden = True End Sub |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Aug 5, 12:43*pm, Jacob Skaria
wrote: Dim varPassword As Variant varPassword = Trim(InputBox("Enter Password")) If Trim(varPassword) < "mypassword" Then Exit Sub If this post helps click Yes --------------- Jacob Skaria "Munchkin" wrote: It works! *Thanks so much. *Now - for another question. *I tested it to see what happens if you enter the wrong password and it seems to be stuck in limbo until you enter the correct password. *How do I get the cancel button to end the macro? "Munchkin" wrote: Is there a way to stop the user and have the prompted to enter a password before this macro button is run? *I was this to only be an option for Administrative purposes only. * Sheets("POLICY LIST").Select * * Rows("1:1").Select * * Selection.EntireRow.Hidden = False * * Rows("2:6").Select * * Selection.EntireRow.Hidden = True End Sub you could also put a conditional loop that gives back a message as in do while... if varpasswors<"mypassword" then msgbox("password incorrect") end if loop if you don't want to loop you could just write: varpw=trim(inputbox("pw please")) if strcomp(varpw ,"mypassword",vbTextCompare) <0 then Workbooks("Your WB").Close SaveChanges:=False else your code... end if avoids the do while loop which is sometimes a little glitchy for some. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
link from web page to excel asks for username and password | Excel Discussion (Misc queries) | |||
link to workbook from web page asks for username and password | Excel Discussion (Misc queries) | |||
Excel asks for addin password on exit | Excel Programming | |||
Macro that asks for password | Excel Programming | |||
Web Folders - Excel file -- asks for password again | Excel Programming |