I have a code to verify the user name and password, what I want is counting the times the user enters wrong password and show a msgbox when he enters three continuous wrong passwords:
I have created the following lines which are part of a long code, the code is actually running without errors, but it is not showing the msgbox,
I found some username and password login code that I am editing for my needs, but I am having some trouble with it. I keep getting run time error '448': Named argument not found on the following line:
I am trying to create a log-in page on a userform, frmlogin in "sheet3." The userform is simply a textbox, Username (txtuser) and a textbox, Password (txtpass). Command Button is cmdcheck
I want the User to enter their username and password and for my macro to verify that they match referencing data in a seperate worksheet, (Sheet6).
Upon verification I want the user to be unloaded on "sheet1"
I am currently getting this message: "unable to get vlookup property of the worksheetfunction class"
VB: Private Sub cmdcheck_Click() Dim Username As String Username = txtuser.Text
The problem I run into is when the user does not have access (via Windows Active Directory) to the file located in the "log_file" range. They usually will get the old runtime error 1004. I can easily trap that error but err 1004 is used so many other times, I don't want to mistakenly trap it as something else. Does anyone know of a way to verify and/or check if the user has read/write access to a file (or folder) before opening it?
I need to PAUSE my VBA code (about halfway through) in order to verify some calculations before I can allow the macro to finish running. If the numbers are correct, then I'd like the macro to finish running accordingly. However, if the numbers are incorrect, I need to be able to search my Excel file for the error (the error would be due to a format issue with the data that I pulled in), fix the error, and then let the macro finish running from the point it was paused.
Right now, I've got a Message Box that pops up asking me if the numbers are right and I have to answer YES or NO. I always answer NO so that the macro crashes -- this allows me to check the excel file without having to stop the macro. Once I've fixed the data problem, then I go back into my code and let it run to its conclusion.
I have a 3 2 user forms, plus a calandar pop-up user form. One is a Log In Screen with a user id combo box and a password textbox referenced to ranges in a very-hidden sheet.
My second form is a spend tracker with mulitple fileds, text boxes, combo boxes, etc.
One of the fields in the spend tracker is user name, what I would like to do is when a user enters their user name and password the entered user name as long as it matches one in the database be populated in the user name field and not allow it to be edited. Is there a way to do this, if so, what is the code and where do I put it.
I will attach my file so you can check it out. Log in: tester
How would I code a button on a userform to request a password input before opening the form? And as a second level of protection - can I code it to only display asterick's when typing in the password.
My macros are set up with hard-coded passwords to protect and unprotect the sheets where they run.
But I need a way for the macros to refer to a user-provided password without having the user edit the macos themselves. The simplist approach (I suppose) would be to have a worksheet for this with a cell for the user to enter the password he/she wants. The macro protect/unprotect code would then look at the cell to get the password.
I have coded a user form to automatically unprotect a sheet, then protect it with a password after data is entered from the User Form. Works great. However, after it is protected through the User Form script, I cannot unprotect the sheet to edit it. It will not recognize that it is the correct password, although it is.
Private Sub cmdOK_Click() Dim NextRow As Long NextRow = Application.WorksheetFunction.CountA(Range("b:b")) + 2 Cells(NextRow, 2) = txtAddProvider.Text ActiveSheet.Unprotect Password = "stats@fwh" Range("B3:B21").Select Selection.AutoFilter Selection.AutoFilter ActiveWorkbook.Worksheets("Lists").AutoFilter.Sort.SortFields.Clear ActiveWorkbook.Worksheets("Lists").AutoFilter.Sort.SortFields.Add Key:=Range( _ "B3:B21"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _ xlSortNormal With ActiveWorkbook.Worksheets("Lists").AutoFilter.Sort .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With ActiveSheet.Protect Password = "stats@fwh" End Sub
I have a workbook which contains multiple worksheets of employees' information. I'm hoping to share this workbook out. Each employee only able to view and update their own worksheet and their manager, being able to view/update everything within the workbook.
I have an input box for a password, and my vb code checks the password against a list, and if it is correct allows the user to continue. I want to change the input box for a user form, as it allows more text on the form, and I also want to include a checkbox that the user must tick to show that they have read and understood the instructions. I have defined the form, but am having trouble getting the form to interpret the user input.
The form has one checkbox, which needs to be ticked to continue, otherwise give a message saying that you have to confirm. It also has one textbox, for the user to input the password. I dont understand how to name the contents of the text box, and use it in the following code. Also do I need a "send" button on the user form, for the user to click after entering the password. If so how does that work?
I'm trying to write what is supposed to be a simple script that looks at a column of usernames (ColumnA) and passwords (ColumnB). I start off by prompting the user to enter their username in an input box and then I want a loop to check this value against the values in Column A. If the username exists, I want to prompt an input box for the password. If the username does not exist I need some kind of limit on the loop to prompt an input box for the user to enter a new username and password that I'll add to the last row of the data table. The loop part is kicking my butt, this is what I have so far...
Sub Main() Set StartRange = Worksheets("16.10"). Range("A1") username = InputBox("Please enter your username.", "Enter username", "Jdoe") i = 1 Do While StartRange.Offset(i, 0).Value <> "username" i = i + 1 Loop If StartRange.Offset(i, 0).Value = "username" Then password = InputBox("Please enter your password.", "Enter password", "password") End If End Sub
I have userform in excel which asks user to enter user id and password. I want a to have "Remember Me" check button on my userform which will remember user details and he wouldn't have to enter user id and password again and again.
I have a sheet which i made ages ago and cant remember my pw. I can goto the alt, F11 select the macro and run it which i have set from all sheets to hide, and i can change the wording on the sheets but i cant open the code.
Does this mean i will have to forget about it unless i remember the pw?
I have an add-in which I want to share with others, but I want to protect the code from modification.
I know how to apply a password to a VBA project (Tools -> Project Properties -> Protection) but the problem is this: when a colleague installs the add-in, the subroutines within the add-in are not available in the Macros list to be added to the ribbon (in the Customize Ribbon window). The subroutines only appear when I remove the password.
I`m struggling to insert password protection to code.If Yes is selected from the messagebox then a messagebox opens and asks for a password.
Code: Sub DeleteRanges()
If MsgBox("Are you sure you want to delete data ?", vbYesNoCancel + vbExclamation, "Delete data") = vbYes Then With Sheets("Score") For i = 3 To 273 Step 10 .Range("D" & i).Resize(7, 11).ClearContents Next End With End If
I have an excel spread sheet with say 20 or so sheets. Sheet 20 known as "Rates" is hidden. What I would like to do is when the user presses a command button say on sheet 1 he is asked for a password which will unhide the Rates sheet . If he gets it wrong a message pops up say incorrect please try again or have an exit button to cancel.
I have a workbook whose worksheets I want to protect on open, and also want to unprotect by way of a module. The protect code is:
Code: Private Sub Workbook_Open() Sheets("Cornealrings").Protect Password:="elohim" Sheets("Ferrararings").Protect Password:="elohim" Sheets("Kera Rings").Protect Password:="elohim" Sheets("IS CALCULATOR").Protect Password:="elohim" Sheets("IS Manager").Protect Password:="elohim" End Sub
The unprotect code is:
Code: Sub Unprotect() Sheets("Cornealrings").Unprotect Password:="elohim" Sheets("Ferrararings").Unprotect Password:="elohim" Sheets("Kera Rings").Unprotect Password:="elohim" Sheets("IS CALCULATOR").Unprotect Password:="elohim" Sheets("IS Manager").Unprotect Password:="elohim" End Sub
The code stops at the first line of the unprotect event, with the message that the password is not correct. If I try to manually unprotect, the password is accepted.
i currently have created a macro for copy a selection of cells from one work book to another. The file were i am copying the cells from is Track_&_Trend_00.xls. In this there is a password to open and modify. The sheet that the cells are being pasted to is TRACK & TREND.xls. There is no password on this. My macro runs fine only that midway through it asks for the password to open and the password to modify for the sheet Track_&_Trend_00.xls.
I wonder ifany one would know about entering input lines of code below to automatically put these passwords in and not having the two password dialog boxes pop up midway through running the macro.
I am trying to add a command button that will set a custom view, password protect all worksheets, and finally password protect the entire workbook structure. The code I am using will correctly set the view and add the password to the worksheets, but it will not apply the password to the workbook structure. What do I need to add?
I have created a workbook that mostly works with VBA codes. Within the code I have ensured that certain worksheets remain hidden. However, I have also written a macro to access what I called the ADMIN worksheet, which has several commands enabling updates and troubleshooting. Long story short, I would ideally like to prevent users from accessing that worksheet. I have already created a prompt (Msgbox) asking the user if he/she wishes to proceed with the macro but I would prefer being able to have a password prompt to run the macro.
I have a code that opens a workbook and saves it under one file name and then saves it under 2 different file names, but it keeps on saving them as password protected and I can't work out why. Would it be something to do with the code or something else? The following is the code I am using:
Am trying to find the VBA code to "ask a user for the password to unhide multiple sheets/tabs"
I have got the script for unhiding all sheets which is:
Sub Sheets_Unhide() Dim sh As Worksheet For Each sh In Worksheets sh.Visible = True Next End Sub
What i would like though is for it to prompt with a password first before the code is executed for unlocking 50 odd sheets.. I know its not 100% fool proof, but would do for what i need!
I have a protected sheet so specific people can only see certain things. I would like code to Unhide a tab called "Estimating" and unhide Rows 2 through 9 and rows 24, 26 and 27.
I have a 2010 excel workbook with several locked worksheet (to which I manage the PW). I and another staff member manage different section of the macro but the other staff member doesn't have access to the locked areas.
Is there a way I can encrypt the password within VBA so it's not visible to the other staff member?
Locking the VBAProject doesn't work as the other staff member has to be able to edit his VBA section.
Many staff run the macro (via a button) and don't need to access the Macro and don't have access to the protected sheets.
I understand excel isn't ideal with PW protection for people wanting to bypass the protection and this isn't an issue.