Losing Lookup references when refreshing datatable

Jat999

New Member
Joined
May 7, 2016
Messages
49
Hi All

I am having troubles in trying to maintain references to a SQL datatable.

I have a sheet where the user enters an order number, there is some VBA codes that runs an SQL script to an external database to bring back information to a datatable.
All this works fine.
However there is then, on the user sheet, some vlookups that refer to various fields on the datatable.
My problem is that whenever the SQL database refreshes the datatable, some of the lookups fail with a #REF !.
I have tried creating absolute cell references but this does not work.


Any ideas please - this has been bugging me all evening - tired and needing sleep....

Thanks in advance
John
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Apologies - in my post above I refer to vlookups. I actually mean I am referencing cells directly on the data table and getting the errors.

i did mention I was tired....
 
Upvote 0
hello, John

Try giving the datatable a simple defined name, and have the lookups reference/use that name (instead of what I assume is currently a range reference like 'Sheet1'!A1:Z999)

HTH. regards, Fazza
 
Upvote 0
Re: Losing Lookup references when refreshing datatable - Solved

Solved

Using Index function.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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