View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Phillip[_5_] Phillip[_5_] is offline
external usenet poster
 
Posts: 33
Default Last 4 digits of SSN



This works for me
Phillip UK London

Put this code in the sheet module
Right click sheet tab and select view code

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Thiscell As Range
Static Lastcell As Range

If Target.Cells.Count 1 Then Exit Sub
Set Thiscell = Target
Set Lastcell = Thiscell
If Lastcell Is Nothing Then Exit Sub
Lastcell.Value = VBA.Right(Lastcell.Value, 4)

End Sub