Could you check my code please

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
3,935
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: 4
Last edited:

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,983
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.
 

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
3,935
Office Version
  1. 2007
Platform
  1. Windows
I have now & worked a treat. Thanks.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,587
Messages
5,637,228
Members
416,963
Latest member
samfuge

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
Top