Assign Value to Single Alphabet In excel
Dim AffectedRange As Range
Dim Cell As Range
Dim TrgetRow As Long
Set AffectedRange = Intersect(Target, Me.Range("B2:B100"))
'VBA Code By Excelmind
If Not AffectedRange Is Nothing Then
Application.EnableEvents = False
For Each Cell In AffectedRange
TrgetRow = Cell.Row
If Cell.Value = "P" Then
Me.Cells(TrgetRow, "B").Value = "Present"
ElseIf Cell.Value = "A" Then
Me.Cells(TrgetRow, "B").Value = "Absent"
Else
Me.Cells(TrgetRow, "B").ClearContents
End If
Next Cell
Application.EnableEvents = True
End If
End Sub