I have this code in a workbook.
Everything works as it is coded. However, If I change the range to ("L6:L5000") and anything associated with the range, the message box STILL appears when you enter a value in column H. It should appear after an entry in column L. I have even copied the code to word, changed the code in Word, erased the old code, made a copy of the sheet, re-pasted the new code, and it still refers back to the old range!
Why? What am I missing?
Thanks in advance,
Jim
VBA Code:
Dim cr As Range
Set cl = Range("H6:H5000")
Set cl = Intersect(Target, cl)
For Each cl In Target
Select Case True
Case 8 = cl.Column 'H
If cl.Value <> "" Then
Check = MsgBox("Is this entry correct?" & vbCrLf & "This cell cannot be edited after entering a value.", vbYesNo + vbQuestion, "Cell Lock Notification")
If Check = vbYes Then
Target.Rows.EntireRow.Locked = True
Else
Cells(cr.Row, "H").Value = ""
End If
End If
Case Else
End Select
Next cl
Application.EnableEvents = True
End Sub
Why? What am I missing?
Thanks in advance,
Jim