How to convert time to decimal format automatically...

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!
 
D

Debra Dalgleish

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
'=========================
 
Top