Forum Discussion
Help needed on formula/VBA for auto fill
TomStyles Doable, but don't think you need VBA for this. Choose one of several functions that can lookup the route information from one table (LOOKUP, VLOOKUP, INDEX combined with MATCH, XLOOKUP) and return the milage in another. It depends a bit on how your data looks like.
Riny_van_Eekelen Thanks so much for coming back to me. Data set looks like this:
| Journey Date | Details of Route | Actual Mileage |
| 01/10/2019 | HO-BOD-HO | |
| 02/10/2019 | HO-TRU-HO | |
| 08/10/2019 | HO-FAL-HO |
I was thinking of setting the Route Details Column to a set dropdown list and then once I've clicked on the desired route I'm hoping the Actual Mileage cell will auto fill the correct mileage.
Many thanks
Tom
- Riny_van_EekelenMar 09, 2020Platinum Contributor
TomStyles Ooops. Edited my file as it contained a small error!
- TomStylesMar 12, 2020Copper Contributor
Thanks Riny_van_Eekelen, you've been so helpful. I really appreciate it! What was the error as you didn't attach the updated file :).
So by using VLOOKUP I can set up a separate sheet with all the preset routes and miles and pop that formula in the mileage column on the original sheet.
- Riny_van_EekelenMar 12, 2020Platinum Contributor
TomStyles Sorry! See attached. I had forgotten to include the last part (FALSE) in the formulae.
- Riny_van_EekelenMar 09, 2020Platinum Contributor
TomStyles Something like in the attached file?