JimS
04-05-2011, 12:17 PM
I'm using a Worksheet_Change function to run a Macro when cell C12 is changed.
How can this be modified so that it looks at cell C20 also.
BOTH cell must contain data (neither one can be blank). Also if one is blank can the Worksheet_Change function make the blank cell the Active cell?
So if c12 has data but c20 is blank - c20 will become the active cell or if c20 has data but c12 is blank then c12 will become the active cell.
Once both cells have data then the Macro can run.
Below is what I'm currently using (just to monitor for C12).
Any ideas?
Thanks...
JimS
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Me.Range("C12")) Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
' On Module-3
Run ("Select")
endit:
Application.EnableEvents = True
End Sub
How can this be modified so that it looks at cell C20 also.
BOTH cell must contain data (neither one can be blank). Also if one is blank can the Worksheet_Change function make the blank cell the Active cell?
So if c12 has data but c20 is blank - c20 will become the active cell or if c20 has data but c12 is blank then c12 will become the active cell.
Once both cells have data then the Macro can run.
Below is what I'm currently using (just to monitor for C12).
Any ideas?
Thanks...
JimS
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Me.Range("C12")) Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
' On Module-3
Run ("Select")
endit:
Application.EnableEvents = True
End Sub