Question: Excel VBA: cant get a match, error unable to get the match property of the WorksheetFunction class For the love of all that is good,


User Management Worksheets sheet1 sheet2 sheet3 User ID User Name Role Password 35120001 Nada azd Admin 567 35120002 Mohammad Saad User 123 35120003 Farah Nasser User 123 35120004 Manar Mohammad User 123 35120005 Khaled Aziz User 123 35120006 Maha Fares User 123 Unlocked Unlocked Unlocked Locked Hidden Unlocked Unlocked Unlocked Unlocked Locked Hidden Locked Unlocked Unlocked Unlocked Locked Hidden Locked Unlocked Unlocked Unlocked Locked Hidden Locked Visual Basic for Applications Run-time error '1004": Method 'Match' of object 'WorksheetFunction' failed Help Continue End Debug Login Login: User Name 35120001 Password 567 Login Password Reset Click CommandButton1 MsgBox "Please enter the User ID", vbCritical Exit Sub End If If Me.txt_Password.Value = "" Then MsgBox "Please enter the password", vbCritical Exit Sub End If If Application.WorksheetFunction.Countif(sh.Range("A:A"), Me.txt_UserName.Value) = 0 Then MsgBox "User ID does not exists", vbCritical Exit Sub End If Dim user_row As Integer user_row = Application WorksheetFunction Match(Me.txt_UserName.Value, sh.Range("A:A", 0) if CStr(sh.Cells(user_row, 4).Value) Me.txt_Password.Value Then MsgBox "Invalid password", vbCritical Exit Sub End If Check the Worksheet Access ... Dim lock_worksheet, unlock_worksheet As Integer lock_worksheet = Application WorksheetFunction.Countif(sh.Range("E & user_row, "XFD" & user_row), "Locked") unlock_worksheet = Application WorksheetFunction.Countf(sh.Range("E" & user_row, "XFD" & user_row), "Unlocked")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
