Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mike
 
Posts: n/a
Default Convert hours to minutes within cell?

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


  #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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
comparing a value in a cell to see if it is higher than a number PK Excel Worksheet Functions 9 June 2nd 05 03:35 PM
How do I add/subtract hours and minutes when some values exceed 2. lhasalass Excel Discussion (Misc queries) 2 May 25th 05 04:50 PM
Convert hours and minutes in time format into fractions of hours.. Akern Excel Worksheet Functions 4 April 21st 05 02:56 PM
How can I convert fractional hours to minutes? Speck Teck Excel Discussion (Misc queries) 3 March 4th 05 01:18 AM
convert minutes into hours:minutes tlf713 Excel Worksheet Functions 3 December 15th 04 11:42 PM


All times are GMT +1. The time now is 03:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"