redspanna
Well-known Member
- Joined
- Jul 27, 2005
- Messages
- 1,604
- Office Version
- 365
- Platform
- Windows
Hi,
I have taken this code from another source that will auto change a time format when entered anywhere on a sheet to show it as h:mm.
I only want this procedure to auto correct through range F3:T2000, what can be added to the code so that it works only through this range?
Thanks in advance
I have taken this code from another source that will auto change a time format when entered anywhere on a sheet to show it as h:mm.
I only want this procedure to auto correct through range F3:T2000, what can be added to the code so that it works only through this range?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value < 0 Or Target.Value > 1 And Target.NumberFormat <> "h:mm" Then Exit Sub
Application.EnableEvents = False
Target.Value = Target.Value / 60
Target.NumberFormat = "mm:ss"
Application.EnableEvents = True
End Sub
Thanks in advance