M
MathewPBennett
Good evening all.
Re-posted again from misc. - sorry again.(RDB)
I am learning the usefulness of the Sub Worksheet_Change(ByVal Target As Range)
However I cannot seem to resolve the fact that I do not seem to be allowed
to have more than one of these subroutines in the same worksheet, even though
they do different things and have different Target Values and/or Ranges.
Am I missing something fundamental here? I have tried naming the sub differently,
ie with Sub Worksheet2_Change(ByVal Target As Range) or
Sub Worksheet_Change2(ByVal Target As Range).. etc, but to no avail.
Is this possible, or do I have to combine all my requirements into one sub?
Thank you to Ron De Bruin for his post in misc. but I am really non-the-wiser.
my code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("AJ:AK"), Target) Is Nothing Then
If Target.Value = "t" Then
Target.Value = Now
End If
End If
End Sub
I would like to repeat this in the same worksheet, for different ranges,
and for different target values then different date, ie next friday (for which
I have code from Tom O.)
Assistance required, sorry RDB.
Mathew
Re-posted again from misc. - sorry again.(RDB)
I am learning the usefulness of the Sub Worksheet_Change(ByVal Target As Range)
However I cannot seem to resolve the fact that I do not seem to be allowed
to have more than one of these subroutines in the same worksheet, even though
they do different things and have different Target Values and/or Ranges.
Am I missing something fundamental here? I have tried naming the sub differently,
ie with Sub Worksheet2_Change(ByVal Target As Range) or
Sub Worksheet_Change2(ByVal Target As Range).. etc, but to no avail.
Is this possible, or do I have to combine all my requirements into one sub?
Thank you to Ron De Bruin for his post in misc. but I am really non-the-wiser.
my code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("AJ:AK"), Target) Is Nothing Then
If Target.Value = "t" Then
Target.Value = Now
End If
End If
End Sub
I would like to repeat this in the same worksheet, for different ranges,
and for different target values then different date, ie next friday (for which
I have code from Tom O.)
Assistance required, sorry RDB.
Mathew