I have a codes below for my simple log.When I try to run it I got an error message Run-Time error'13' Type mismatch. I don't know what is the problem. Thanks if someone can help me on this.
Code:
Dim UserRow, SheetCol As Long
Dim SheetNm As String
With Sheet1
.Calculate
UserRow = .Range("B8").Value 'User Row
For SheetCol = 8 To 13
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
Last edited by a moderator: