Saturday, December 23, 2023

Assign Value to Single Alphabet In Excel By Excelmind

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


How To Use Vlookup In Merged Cells

  How To Use Vlookup In Merged Cells Click Here to download sample file for practice Note: Download the file and open with microsoft excel