Change :47:57 to 0:47:57
Good Morning, Bob:
Excellent! It worked perfectly!!!! Thank you for lending your expertise!
--
jeannie v
"Bob Phillips" wrote:
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If Left(.Value, 1) = ":" Then
.Value = "0" & .Value
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
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"jeannie v" wrote in message
...
Hi Experts:
I have a Macro that will pop time to a worksheet...the problem is I can't
determine how to make it pop with a left Zero fill if there are no hours.
Example: :47:57 change to 0:47:57 whe the Macro pops instead of the
:47:57.
Can anyone tell me how to do this?
Thanks for your assistance,
--
jeannie v
|