abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,430
- Office Version
- 2019
- 2010
- Platform
- Windows
hello
I need help from the experts to how I add message box after three times of tries to select cells in column a and close the file
this is my code so far
I need help from the experts to how I add message box after three times of tries to select cells in column a and close the file
this is my code so far
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Columns(1)) Is Nothing Then Exit Sub
If Not Intersect(Target, Columns(1)) Is Nothing Then
MsgBox "you can't add any values": Target.Value = Range("b2").Select: Target.Value = "": Exit Sub
End If
End Sub