Seniornetman
New Member
- Joined
- Dec 14, 2023
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I want to increment a number in one cell based on the letter P, T or A in another cell. How can I go about this?
No I mean the number 1 in A and it increments to 2 when P is entered in B
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range, s
Set c = Intersect(Target, Range("B2"))
If c Is Nothing Then Exit Sub
s = UCase(c)
If s = "P" Or s = "T" Or s = "A" Then
Application.EnableEvents = False
Range("A2") = Range("A2") + 1
Application.EnableEvents = True
End If
End Sub