sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
Good Morning,
I've started some code below where I'd like the data from a few cells (times and dates) to be computed. The answer should popup in a msgbox and then it should ask me if this data should be put into Cells "W33" and "Y33"
I've got some of this code wrong and it's giving me errors on the path4. Thanks for the help.
I've started some code below where I'd like the data from a few cells (times and dates) to be computed. The answer should popup in a msgbox and then it should ask me if this data should be put into Cells "W33" and "Y33"
I've got some of this code wrong and it's giving me errors on the path4. Thanks for the help.
Code:
Sub ETA_CALC1()
Dim Path1 As String
Dim Path2 As String
Dim Path3 As String
Dim Path4 As String
Dim Path5 As String
Dim Path6 As String
Dim Path7 As String
Dim Path8 As String
Path1 = ActiveSheet.Range("R28").Value
Path2 = ActiveSheet.Range("T28").Value
Path3 = ActiveSheet.Range("S29").Value
Path4 = Value
Path5 = Sheets("Developer").Range("G2").Value
Path6 = ActiveSheet.Range("C5").Value
Path7 = ActiveSheet.Range("F4").Value
Path8 = ActiveSheet.Range("D4").Value
Path4 = (Path3 / (((Path2 + Path1 + (Time(Path5, 0, 0))) - (Path7 + Path8 + (Time(Path6, 0, 0)))) * 24))
MsgBox ("Based on your desired Arrival Time and Date and your mileage input, your speed required to make your ETA is:" & vbCrLf & Path4)
End Sub