Roy,
Apologies for the mistake I will endeavour to avoid making that mistake again. Now onto the code, I have done that, one small issue appears. It might be more clear if I tell you what I am look to achieve. I will be running through the column A and find if the cell is empty. if it is, then I need then to unlock(unprotect) the worksheet to the highlight the cell in question and then lock(protect) the sheet using the same password.
No that you have a better idea what I am trying to achieve, this is my current code:
For x = 1 To int_RowCount
If IsEmpty(.Cells(7 + (x - 1), 1)) Then
bln_ErrorFound = True
On Error GoTo try_next
ActiveSheet.Unprotect ("passA")
str_Password = "passA"
try_next:
ActiveSheet.Unprotect ("passB")
str_Password = "passB"
End If
If IsEmpty(.Cells(7 + (x - 1), 1)) Then
.Cells(7 + (x - 1), 1).Select
With Selection.Interior
.Color = 3381759
.TintAndShade = 0.399975585192419
End With
MsgBox str_Password
ActiveSheet.Protect (str_Password)
End If
ActiveWorkbook.Save
Next x
Now I know this code very untidy and I am re-looking at it, but any advise?
Regards,
Bookmarks