Thread: [Solved] Time formulas
View Single Post
 
Old 11-26-2016, 02:57 PM
jeffreybrown jeffreybrown is offline Windows Vista Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

No I don't specifically remember your other spreadsheet, but this should work as sheet module code...

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rng As Range
    Set rng = Target.Parent.Range("A2:A100")
    If Target.Count > 1 Then Exit Sub
    If Intersect(Target, rng) Is Nothing Then Exit Sub
    If Target <> "" Then Target.Offset(, 7).Value = Time
    Target.NumberFormat = "h:mm AM/PM"
End Sub
http://www.rondebruin.nl/win/code.htm
Reply With Quote