Jennifer Van
New Member
- Joined
- Apr 22, 2022
- Messages
- 41
- Office Version
- 2016
- Platform
- Windows
I just received help and fixed the last code and now the first two have stopped working and I cannot work out why.
My main worksheet "Loan Request Return" records information and in column "Q" is a question with Yes/No answer to go to Waitlist - if this says yes then all the information from that row in cells A to Q to be copied and placed into the worksheet "Waitlist". This was automatically done once the Yes was put in the column.
The next piece of the code is the same, except it is om column "AD" that a question with Yes/No answer to go to Repairs - if this says yes then information cells in A,B,C,M,N,O, to be copied into the worksheet "Repairs". This was also automatically done once the Yes was put in the column.
The code is not working now - can someone help me please.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Columns(17)) Is Nothing And Target.Row >= 5 Then
If Target.Value = "Yes" Then
Range(Cells(Target.Row, "A"), Cells(Target.Row, "P")).Copy Sheets("WaitList").Range("A" & Rows.Count).End(3)(2)
End If
End If
If Not Intersect(Target, Columns(31)) Is Nothing And Target.Row >= 5 Then
Dim tr As Long: tr = Target.Row
If Target.Value = "Yes" Then
Cells(tr, "M").Resize(, 3).Copy Sheets("Repairs").Range("C" & Rows.Count).End(3)(2)
End If
End If
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Columns(14)) Is Nothing And Target.Row >= 5 Then
Dim Sval As Range, wsEL As Worksheet, wsLRR As Worksheet
Set wsLRR = Sheets("Loan Request Return")
Set wsEL = Sheets("Equipment Library")
Set Sval = wsEL.Columns("C:C").Find(Target.Value)
If Target.Value = Sval.Value Then
Target.Offset(, 9).Resize(, 4).Copy Sval.Offset(, 13)
End If
End If
End Sub
My main worksheet "Loan Request Return" records information and in column "Q" is a question with Yes/No answer to go to Waitlist - if this says yes then all the information from that row in cells A to Q to be copied and placed into the worksheet "Waitlist". This was automatically done once the Yes was put in the column.
The next piece of the code is the same, except it is om column "AD" that a question with Yes/No answer to go to Repairs - if this says yes then information cells in A,B,C,M,N,O, to be copied into the worksheet "Repairs". This was also automatically done once the Yes was put in the column.
The code is not working now - can someone help me please.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Columns(17)) Is Nothing And Target.Row >= 5 Then
If Target.Value = "Yes" Then
Range(Cells(Target.Row, "A"), Cells(Target.Row, "P")).Copy Sheets("WaitList").Range("A" & Rows.Count).End(3)(2)
End If
End If
If Not Intersect(Target, Columns(31)) Is Nothing And Target.Row >= 5 Then
Dim tr As Long: tr = Target.Row
If Target.Value = "Yes" Then
Cells(tr, "M").Resize(, 3).Copy Sheets("Repairs").Range("C" & Rows.Count).End(3)(2)
End If
End If
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Columns(14)) Is Nothing And Target.Row >= 5 Then
Dim Sval As Range, wsEL As Worksheet, wsLRR As Worksheet
Set wsLRR = Sheets("Loan Request Return")
Set wsEL = Sheets("Equipment Library")
Set Sval = wsEL.Columns("C:C").Find(Target.Value)
If Target.Value = Sval.Value Then
Target.Offset(, 9).Resize(, 4).Copy Sval.Offset(, 13)
End If
End If
End Sub