View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Mike,

Try this

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("H1:H10")) Is Nothing Then
With Target
If InStr(1, .Text, ":") 0 Then
.Value = .Value * 24 * 60
.NumberFormat = "General"
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mike" wrote in message
...
Is there a way to have a value typed into a cell automatically converted
from minutes to hours? Not a formula - at least not in the usual sense -
since the formula would be overwritten.

Thanks in advance,

Mike