i have two almost identical workbooks to record service activity in two different teams. i have a macro running on worksheet A but the same macro doesnt work on worksheet B.
here is the code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'' dvuppx
'
Dim Ws As Worksheet
Application.EnableEvents = False
On Error GoTo Xit
If Target.Column <> 70 Or UCase(Target.Value) <> "YES" Then GoTo Xit
Set Ws = Sheets("121 Disch")
Target.EntireRow.Copy Ws.Range("A" & Rows.Count).End(xlUp).Offset(1)
Ws.Range("BP" & Rows.Count).End(xlUp).Offset(, 1) = Date
Target.EntireRow.Delete
Xit:
Application.EnableEvents = True
End Sub
the aim is to input the word 'yes' in column BN on the sheet named '121 C+D' and for the row to then move to the sheet '121 Disch' and add the date on the end of the show. I have no idea why this works perfectly on one but the other. any help would be appreciated.
here is the code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'' dvuppx
'
Dim Ws As Worksheet
Application.EnableEvents = False
On Error GoTo Xit
If Target.Column <> 70 Or UCase(Target.Value) <> "YES" Then GoTo Xit
Set Ws = Sheets("121 Disch")
Target.EntireRow.Copy Ws.Range("A" & Rows.Count).End(xlUp).Offset(1)
Ws.Range("BP" & Rows.Count).End(xlUp).Offset(, 1) = Date
Target.EntireRow.Delete
Xit:
Application.EnableEvents = True
End Sub
the aim is to input the word 'yes' in column BN on the sheet named '121 C+D' and for the row to then move to the sheet '121 Disch' and add the date on the end of the show. I have no idea why this works perfectly on one but the other. any help would be appreciated.