ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   worksheet_change problems (https://www.excelbanter.com/excel-programming/292811-worksheet_change-problems.html)

pauluk[_6_]

worksheet_change problems
 
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

--
Message posted from http://www.ExcelForum.com


Frank Kabel

worksheet_change problems
 
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

--
Regards
Frank Kabel
Frankfurt, Germany

What i require is when a member of the team types cancelled into cell
G ROW then the colums for that N:T for that row are filled with N/A I
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 Sub


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 03:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com