Converting Numeral to Time equivalent
Hi Mark,
Am Wed, 18 Nov 2020 20:38:30 -0800 (PST) schrieb NoodNutt:
Claus, if by chance you're reading this, I also found this issue in the example file you sent me.
try:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("C3:C43,H3:H43,J3:K43")) Is Nothing _
Or Target.Cells.Count 1 Then Exit Sub
Dim iHrs As Integer, iMins As Integer
Select Case Target.Column
Case 3
If Target.Value = "YARD" Or Target.Value = "C0654" Then
Target.Offset(0, 7).Select
Else
Target.Offset(0, 1).Select
End If
Case 8
Target.Offset(0, 2).Select
Case 10, 11
If IsNumeric(Target) And Target 2 Then
iHrs = Target.Value \ 100
iMins = Target.Value Mod 100
Target = TimeSerial(iHrs, iMins, 0)
Target.NumberFormat = "[h]:mm"
Target.Offset(0, 1).Select
End If
End Select
End Sub
Regards
Claus B.
--
Windows10
Office 2016
|