How can I merge these scripts to run on the same worksheet? Each works individually if they are the only script on that worksheet.
Macro to change col D & G to CAPs
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("D2:D9999")) Is Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
If Not Application.Intersect(Target, Range("G2:G9999")) Is Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
Application.EnableEvents = True
End Sub
Macro for TOD entry w/o ":" in col B
Private Sub Worksheet_Change(ByVal Target As Range)
Dim vVal
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Range("B2:B9999")) Is Nothing Then Exit Sub
With Target
vVal = Format(.Value, "0000")
If IsNumeric(vVal) And Len(vVal) = 4 Then
Application.EnableEvents = False
.Value = Left(vVal, 2) & ":" & Right(vVal, 2)
.NumberFormat = "h:mm AM/PM"
End If
End With
Application.EnableEvents = True
End Sub
THANK YOU!
Bookmarks