Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
comparing a value in a cell to see if it is higher than a number | Excel Worksheet Functions | |||
How do I add/subtract hours and minutes when some values exceed 2. | Excel Discussion (Misc queries) | |||
Convert hours and minutes in time format into fractions of hours.. | Excel Worksheet Functions | |||
How can I convert fractional hours to minutes? | Excel Discussion (Misc queries) | |||
convert minutes into hours:minutes | Excel Worksheet Functions |