Hi, Struggling with VBA. Managed to do the basics of what I am trying to achieve, which is gather distances for my logistics company. I used google API to determine road mileage between locations, to determine the distance travelled on a job and then the subsequent empty running to get to the next job.
What I would like to do next is SUM the loaded mileage and the empty mileage together to correctly price the job, and then Subtotal each week's loaded, empty and total miles respectively to build an average earning report.
What is the best way to achieve this? I'm guessing there is a way to do this using VBA, but I was thinking a simpler solution would be extrapolating the dynamic data generated from the API into a static excel cell?
Below is an example of one weeks data, I have been doing one month per sheet so either 4 or 5 tables per sheet to accumulate this data from. Row 5 is a manual entry an example of what I am trying to achieve, the #values are just errors because i donbt have accurate address information further along the table.
Thanks,
What I would like to do next is SUM the loaded mileage and the empty mileage together to correctly price the job, and then Subtotal each week's loaded, empty and total miles respectively to build an average earning report.
What is the best way to achieve this? I'm guessing there is a way to do this using VBA, but I was thinking a simpler solution would be extrapolating the dynamic data generated from the API into a static excel cell?
Below is an example of one weeks data, I have been doing one month per sheet so either 4 or 5 tables per sheet to accumulate this data from. Row 5 is a manual entry an example of what I am trying to achieve, the #values are just errors because i donbt have accurate address information further along the table.
Thanks,
RTK Work 2024.xlsm | |||||
---|---|---|---|---|---|
S | T | U | |||
3 | Job Miles | Empty Running | Total Miles | ||
4 | 222 mi | 3.0 mi | #VALUE! | ||
5 | 497 | 42 | 539 | ||
6 | 174 mi | 44.0 mi | #VALUE! | ||
7 | 194 mi | #VALUE! | #VALUE! | ||
8 | #VALUE! | #VALUE! | #VALUE! | ||
9 | 60.7 mi | 1 ft | #VALUE! | ||
10 | #VALUE! | #VALUE! | #VALUE! | ||
11 | #VALUE! | #VALUE! | #VALUE! | ||
12 | #VALUE! | 49.5 mi | #VALUE! | ||
13 | 191 mi | Error | #VALUE! | ||
14 | #VALUE! | #VALUE! | #VALUE! | ||
TRIAL |
Cell Formulas | ||
---|---|---|
Range | Formula | |
S4,S6:S13 | S4 | =GetDistance([@[From GetDistance Ref]],[@[To GetDistance Ref]]) |
T4,T6:T13 | T4 | =GetDistance([@[To GetDistance Ref]], X5) |
U4:U13 | U4 | =[@[Job Miles]]+[@[Empty Running]] |
S14 | S14 | =SUBTOTAL(109,[Job Miles]) |
T14 | T14 | =SUBTOTAL(109,[Empty Running]) |
U14 | U14 | =SUBTOTAL(109,[Total Miles]) |