Thread: [Solved] Time formulas
View Single Post
 
Old 11-27-2016, 07:09 AM
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

With the attached file, it appears you mean column B! Column A already has a count in it.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rng As Range
    Set rng = Target.Parent.Range("B2:B100")
    If Target.Count > 1 Then Exit Sub
    If Intersect(Target, rng) Is Nothing Then Exit Sub
    If Target <> "" Then
        With Target.Offset(, 6)
            .Value = Time
            .NumberFormat = "h:mm AM/PM"
        End With
    End If
End Sub
Reply With Quote