Guys I want to ask you these two questions:
-What should I change in my code so when I insert and delete rows I do not get the message "You entered wrong information 17 digits" and so forth
- What do I get rid of the sensitivity when comparing "Check", some times the user types check, CHECK, etc. Or is there a way to make all entries uppercase?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Dim newrange As Range
Dim newrange_emplo As Range
Dim newrange_cheque As Range
Application.ScreenUpdating = False
Set newrange = Range("I8:I500")
If Not Intersect(Target, newrange) Is Nothing Then
For Each cell In Intersect(Target, newrange)
If Len(cell) <> 18 And cell.Value <> "Check" Then
MsgBox "You entered wrong information " & Len(cell) & " digits", vbCritical, "ACCOUNT"
Application.EnableEvents = False
cell.ClearContents
cell.Activate
Application.EnableEvents = True
Exit For
End If
Next cell
End If
End Sub
Bookmarks