Help with line that produces error

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.

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
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
You are missing the single quotes ' from around the workbook/sheetname.
It should be like you have it for U3
 
Upvote 0
Is the other workbook open when you run the code?
Also check that the workbook & sheet name are correct.
 
Upvote 0
Wow, I've been trying to figure this out for at least an hour. The workbook I was trying to reference had one character that was wrong in the sheet name :(. I appreciate the help!
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,093
Latest member
catterz66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top