worksheet_change problems

  • Thread starter Thread starter pauluk
  • Start date Start date
P

pauluk

What i require is when a member of the team types cancelled into cell
ROW then the colums for that N:T for that row are filled with N/A
have tried the below code but with no joy


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "G:G" Then
Application.EnableEvents = False
If Target.Value = cancelled Then
Range("N:T").Value = NA
Else
Range("N:T").Value = False
End If
Application.EnableEvents = True
End If
End Su
 
Hi
try the following:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("G:G")) Is Nothing Then Exit Sub
On Error GoTo CleanUp:
With Target
If .Value = "canceled" Then
Application.EnableEvents = False
range(cells(.row,"N"),cells(.row,"T")).value = "N/A"
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub
 
Back
Top