How to convert time to decimal format automatically...

  • Thread starter Thread starter alek23
  • Start date Start date
A

alek23

sorry for the late respond cause i'm a little bit busy, well...it's
working and its great, but how can i do that from A1 to A200 (it just
an example) to convert time to decimal automatically. thanks for fast
and great answer!
 
To convert times entered in column A, change J.E.'s code so it checks
the target column, instead of the target address:

'===================
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If .Column = 1 Then
If InStr(.NumberFormat, ":") Then
Application.EnableEvents = False
.Value = .Value * 24
.NumberFormat = "General"
Application.EnableEvents = True
End If
End If
End With
End Sub
'=========================
 
Back
Top