ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   enter a time into a cell, have the cell show two times the entry (https://www.excelbanter.com/excel-worksheet-functions/24372-enter-time-into-cell-have-cell-show-two-times-entry.html)

johnp

enter a time into a cell, have the cell show two times the entry
 
The cell would have a time format of 00:00:00 or 00:00.
If one entered 01:00:00 into the cell, the cell would show 02:00:00.
If one entered 00:00:32 into the cell, the cell would show 00:01:04.

--
johnp

Vasant Nanavati

"johnp" wrote in message
...
The cell would have a time format of 00:00:00 or 00:00.
If one entered 01:00:00 into the cell, the cell would show 02:00:00.
If one entered 00:00:32 into the cell, the cell would show 00:01:04.


Why???

--

Vasant



JE McGimpsey

This requires an event macro. Assuming that the cell is A1, put this in
your worksheet code module (right-click the worksheet tab and choose
View Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = "A1" Then
Application.EnableEvents = False
.Value = 2 * .Value
Application.EnableEvents = True
End If
End With
End Sub


In article ,
"johnp" wrote:

The cell would have a time format of 00:00:00 or 00:00.
If one entered 01:00:00 into the cell, the cell would show 02:00:00.
If one entered 00:00:32 into the cell, the cell would show 00:01:04.


johnp

Thanks to JEM for great help.
Works great in cell 1A, but how do I get it to work in more than one cell of
a sheet?
Tried editing, but am in the dark as to what to do.
--
johnp


"johnp" wrote:

The cell would have a time format of 00:00:00 or 00:00.
If one entered 01:00:00 into the cell, the cell would show 02:00:00.
If one entered 00:00:32 into the cell, the cell would show 00:01:04.

--
johnp



All times are GMT +1. The time now is 07:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com