Excel Userform Vlookup?

tomsov

New Member
Joined
Mar 31, 2017
Messages
24
Hello, I'm using the following code in my userform that isn't working and produces an error "Expected: list seperator or ) ". I would like to pull data from an external workbook based on an internal server to produce a cost based on the part number using vlookup that is to be inserted into a Textbox (called PartCost)

The way I'm trying to use this is thus:

PartCostVar = Application.WorksheetFunction.IfError(Application.VLookup(itemFind, "\\ER_Server\share\Database\ER-Room\[costbook.xlsx]Parts Data"!$A$3:$E$2740),2,FALSE))
If PartCostVar <> "" Then
Me.PartCost = PartCostVar
Else
Me.PartCost = "N/A"
End If

I'm using a similar method for other information that works - but it isn't based on the server so it seems to be the external link that maybe causing the problem (working code:)

If WorksheetFunction.VLookup(itemFind, Data_Table, 25, False) = "Y" Then
Me.ER_Result = "YES"
Else
Me.ER_Result = "NO"
End If

Thank you!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
You have an extra closing bracket, although I suspect that that the server location will still be a problem.

VBA Code:
PartCostVar = Application.WorksheetFunction.IfError(Application.VLookup(itemFind, "\\ER_Server\share\Database\ER-Room\[costbook.xlsx]Parts Data"!$A$3:$E$2740,2,FALSE))
 
Upvote 0

Forum statistics

Threads
1,215,563
Messages
6,125,550
Members
449,237
Latest member
Chase S

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