If you run your code when the '5' is in cell B12 then UserRow should be 5 and not ""
I am confused now, where are you getting your error currently?
If you paste another picture, include the column letters and row numbers. Also paste the code between code tags (Use the VBA button in the editor and paste between the code tags
Yep my formula works correctly in the cell which is why I am confused.
Sub CheckUser()
Dim UserRow, SheetCol As Long
Dim SheetNm As String
With Sheet11
.Calculate
If .Range("B12").Value = Empty Then 'Incorrect Username'
MsgBox "Please enter a correct user name"
Exit Sub
End If
If .Range("B11").Value <> True Then 'Incorrect Password'
MsgBox "Please enter a correct password"
Exit Sub
End If
LoginForm.Hide
.Range("B9,B10").ClearContents
UserRow = .Range("B12").Value 'User Row'
For SheetCol = 6 To 16
SheetNm = .Cells(4, SheetCol).Value 'Sheet Name'
If .Cells(UserRow, SheetCol).Value = "Ð" Then
Sheets(SheetNm).Unprotect "123"
Sheets(SheetNm).Visible = xlSheetVisible
End If
If .Cells(UserRow, SheetCol).Value = "Ï" Then
Sheets(SheetNm).Protect "123"
Sheets(SheetNm).Visible = xlSheetVisible
End If
If .Cells(UserRow, SheetCol).Value = "x" Then Sheets(SheetNm).Visible = xlVeryHidden
Next SheetCol
End With
End Sub