Hello all,
I am currently attempting to write a macro that filters out New orders, (Anything with N/A in column 11, as shown as first part of code), Copies any visible (filtered) cells, and pastes them onto the first empty line on Column B on another sheet.
Here is what I have written here.
When I Run the code, it highlights my "Set LR" line and gives me "Object not defined" Error, I've tried to Dim LR as an integer, long, I've tried adjusting the code defining my row count.
I am currently attempting to write a macro that filters out New orders, (Anything with N/A in column 11, as shown as first part of code), Copies any visible (filtered) cells, and pastes them onto the first empty line on Column B on another sheet.
Here is what I have written here.
VBA Code:
' ``Filter New Orders
Sheets("Test Ship Report").Activate
Sheets("Test Ship Report").Range("$A$1:$K$1000").AutoFilter Field:=11, Criteria1:="#N/A"
''Set Variables
Dim LR As Integer
Set LR = Sheets("ALL Orders Database").Range("C2").End(xlDown).Row
''Copy Customer Cells After Filter has been applied
Sheets("Test Ship Report").Activate
Sheets("Test Ship Report").Range("C2:C").SpecialCells(xlCellTypeVisible).Select
Selection.Copy
''Pastes Customer Info on First Open Cell on Column D (First Open Cell Variable pulled from Column C)
Sheets("ALL Orders Database").Activate
Worksheets("ALL Orders Database").Range("D2:D" & LR + 1).PasteSpecial Paste:=xlPasteValues
When I Run the code, it highlights my "Set LR" line and gives me "Object not defined" Error, I've tried to Dim LR as an integer, long, I've tried adjusting the code defining my row count.