I am trying to paste a macro into VBA that will select lines of data that contain the column F drop down "BRING FORWARD / À REVOIR" selection in sheet 2 to sheet 10 using the code below.
The idea is that I have a list of just the bring forward lines on sheet 10.
This is the error message I am getting.....Anyone familliar with it?
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim destSht As Worksheet: Set destSht = Sheets("Sheet10")
Dim destLR As Long: destLR = destSht.Range("F" & Rows.Count).End(xlUp).Row + 1
Set rng = Target.Parent.Range("F:F")
If Target.Count > 1 Then Exit Sub
If Intersect(Target, rng) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
If Target.Value = "BRING FORWARD / À REVOIR" Then
Debug.Print destLR
Target.EntireRow.Copy Destination:=destSht.Range("A" & destLR)
End If
Application.ScreenUpdating = True
End Sub
The hilighted error is
: Set destSht = Sheets("Sheet10")
Bookmarks