Formatting for time

D

Dan

I have number in E3 (300) in column P I have the formula
=TEXT((TIME(,,E3)),"mm:ss") which nicely converts it to 5:00 or 5 minutes 299
= 4:59 etc.

what I an trying to do is eliminate column P and use a target formula so
that when the number is typed in E it converts it programatically. I did this
for converting to upper case and was using it as a base for this but I'm not
sure of the syntax for the target.formula:

If Target.Column = 1 Then Exit Sub
If Target.Row = 1 Then Exit Sub
If Target.Column = 5 Then
On Error Resume Next 'insure that Enable Events gets reenabled
Application.EnableEvents = False
'Target.Formula = UCase(Target.Formula)
Target.Formula = Text("mm:ss")
Application.EnableEvents = True
On Error GoTo 0
End If

If Target.Column = 2 Then
On Error Resume Next 'insure that Enable Events gets reenabled
Application.EnableEvents = False
'Target.Formula = UCase(Target.Formula)
'Target.Formula = Text((Time(, , E3)), "mm:ss")
Target.Formula = Text("mm:ss")
Application.EnableEvents = True
On Error GoTo 0
End If


End Sub

I may be way off base but any suggestions or revisions or anything would be
greatly appreciated. Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Need help with Trim function 6
Formatting a single column 6
2 Macros in VBA??? 3
using UCase 2
If statement question 2
MACRO HELP 9
Set value for range of cells! 2
Disapearing formulas 1

Top