Hi all,
I would like each change in each column from YES to NO to change YES or NO respectively in column H in the corresponding row.
I have this code:
I would like each change in each column from YES to NO to change YES or NO respectively in column H in the corresponding row.
I have this code:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MonitoredRange As Range
Set MonitoredRange = Range("A1:C6")
If Not Intersect(Target, MonitoredRange) Is Nothing Then
Dim Cell As Range
For Each Cell In Intersect(Target, MonitoredRange)
If Cell.Value = "TAK" Then
Call ChangeCellValue("TAK", Target.Row)
ElseIf Cell.Value = "NIE" Then
Call ChangeCellValue("NIE", Target.Row)
End If
Next Cell
End If
End Sub
Sub ChangeCellValue(NewValue As String, RowToChange As Long)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Cells(RowToChange, "H").Value = NewValue
Next ws
End Sub