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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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