Could you check my code please

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,832
Office Version
  1. 2007
Platform
  1. Windows
Evening,
Screen shot of page supplied.

I would enter the date in column A then i would select a customer from the dropdown list in column B
Now the cells in column C,D,E should be from the database on the right hand side.

So this is the code in cell C5
VBA Code:
=IFERROR(VLOOKUP($B5,INDIRECT("$N$4:$DB$"&COUNTA('C:\Users\Ian\Desktop\Downloads\New folder\GRASS\REMOTES ETC\DR\REMOTES ETC\DR\[DR.xlsm]INFO'!$CV:$CV)),2,FALSE),"")

What the code should be doing is looking for the name i selected from the drop down list then looking at the database return the correct address.
I ask to check my code as after putting the lookup code in the address bar etc when i then hit enter i get a windown open expecting me to select a file ?

The correct address is returned but not sure why the box opens up ?

Also after making a selection from the drop down list the address,cost & mileage seems to take too long to be entered into the cells.
As opposed to click & there entered i see the cursor going around & around as if the code is incorrect etc.

Thanks
 

Attachments

  • 6887.jpg
    6887.jpg
    155.6 KB · Views: 9
Last edited:

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Have you tried
=IFERROR(VLOOKUP($B5,$N:$DB,2,FALSE),"")

The whole column reference should be faster than looking at a closed, external workbook (that's where the window is coming from) and applying that to an volatile INDIRECT.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
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