=REST(H1-G1;1) in VBA
reinhardt
Eintragungen aus einer Usrform werden wie u.a. in ein TB eingetragen.
Cells(MyRow, 7).Value = Me.TextBox5.Text 'Ankunft Zeit
Cells(MyRow, 8).Value = Me.TextBox6.Text 'Anfahrt Zeit
Die Fahrzeit errechne und trage ich ein mit:
Cells(MyRow, 9).FormulaLocal = "=" & Cells(MyRow, 8).Address & "-" & Cells(MyRow, 7).Address 'Errechnen Fahrzeit
Nun bekomme ich manchmal aufgrund der Werte eine negative Zeit, z.B. aus
Abfahrt: 8:00
Ankunft: 01:59
Im Tabellenblatt bekomme ich das mit der Formel =REST(H1-G1;1) hin.
Ich bräuchte einmal Hilfe bei der VBA schreibweise anstatt:
Cells(MyRow, 9).FormulaLocal = "=" & Cells(MyRow, 8).Address & "-" & Cells(MyRow, 7).Address
?
Gruß Reinhardt.