PDA

View Full Version : Solved: Triggering a sub with a change in a range



Rejje
05-30-2011, 06:04 AM
Hi!

How do I change below code to call for the macros with the change of Range("EXP_01") rather than with the change of anything within the worksheet?

Public Sub Worksheet_Change(ByVal Target As Range)

Call HideColumns_KP
Call HideRows_KP
Call FontSize

End Sub

JKwan
05-30-2011, 06:34 AM
Try this:

Private Sub Worksheet_Change(ByVal Target As Range)
If (Not Intersect(Target, Range("EXP_01")) Is Nothing) Then
MsgBox "inside range"
End If
End Sub

Rejje
05-30-2011, 06:48 AM
Thanks!

Public Sub Worksheet_Change(ByVal Target As Range)

If (Not Intersect(Target, Range("EXP_01")) Is Nothing) Then

Call HideColumns_KUNDPOST
Call HideRows_KUNDPOST
Call FontSize

End If

End Sub


Perfect!