Brock_Hardchest
New Member
- Joined
- Feb 23, 2018
- Messages
- 27
Hello,
A line in my VBA code produces a 1004 error: Application-defined or object-defined error. The code is nearly identical to other code I have but this line keeps giving an error, when on the other spreadsheet the same line does not produce an error. Any help is appreciated, see code below.
A line in my VBA code produces a 1004 error: Application-defined or object-defined error. The code is nearly identical to other code I have but this line keeps giving an error, when on the other spreadsheet the same line does not produce an error. Any help is appreciated, see code below.
Code:
'find bottom row of Pivot tab
Worksheets("Pivot").Activate
PivotRow = Cells(Rows.Count, 1).End(xlUp).Row
'move pivot table to summary tab
Sheets("Pivot").Range("A3:D" & PivotRow).Copy
Sheets("Summary").Cells(3, 1).PasteSpecial
'find difference in billing and raw
Sheets("Summary").Range("E3").Formula = "=D3-C3"
Sheets("Summary").Range("E3:E" & PivotRow).FillDown
'marking 1 or 0 for variance
Sheets("Summary").Range("F3").Formula = "=IF(E3<>0,1,0)"
Sheets("Summary").Range("F3:F" & PivotRow).FillDown
'Match and Index Function to make product Hierarchy
Worksheets("Summary").Activate
Range("S3").Formula = "=""043_"" & $A3"
Range("S3:S" & PivotRow).FillDown
Range("U3").Formula = "=MATCH(B3,'[Product Hierarchy.xlsx]Sheet1'!$A$2:$A$1032,0)"
Range("U3:U" & PivotRow).FillDown
Range("V3").Formula = "=MATCH($S3,[143 pricelist detail.xlsx]143 Pricelist Detail!$A$2:$A$350000,0)" '***THIS IS THE LINE THAT PRODUCES THE ERROR***
Range("V3:V" & PivotRow).FillDown