Hi Scott
It is just a question of adding another Case statement to the event code that you have on the data entry sheet.
Event code (in this case the change of a value in a cell) is triggered by the fact that an alteration has taken place in a specified range.
You are using the range of Target.column so it is just a simple addition to your code as shown below
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Column
Case 1 ' columns C & E are 3rd & 5th columns
TypedVal = Application.WorksheetFunction. _
Text(Target.Value, "000000")
NewValue = Left(TypedVal, 2) & "/" & _
Mid(TypedVal, 3, 2) & "/" & _
Right(TypedVal, 2)
Case 5, 6 ' Columns E & F are time columns
TypedVal = Application.WorksheetFunction. _
Text(Target.Value, "0000")
NewValue = Left(TypedVal, 2) & ":" & _
Right(TypedVal, 2)
Case 13 ' change in the Invoice # column (M)
Call CollectInvoices
Case Else
End Select
If NewValue > 0 Then
Application.EnableEvents = False
Target.Value = NewValue
Application.EnableEvents = True
End If
End Sub
If a value changes in column M, then my macro will be called and run.
Bookmarks