Worksheet Change ByVal Formulated Value Change

rickincanada

Board Regular
Joined
Aug 31, 2010
Messages
61
Hi there I'm struggling with the following problem and hoping that someone can provide me with some guidance.

I'm attempting to use the Worksheet_Change(ByVal Target As Range) to call a macro when Target.Address = "$F$25" however the problem is that F25 is a formulated value. Therefore I'm wanting the macro to run when other cells are modified that effect the value in F25. The reason for this is I have a series of check boxes that effect the value in this cell, therefore using the Change ByVal on the check box cells doesn't work. The trouble is that even when the value in F25 changes the macro doesn't run as the formula in F25 hasn't been modified. Is this possible?

Thanks for any help you can provide.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try using

Private Sub Worksheet_Calculate()

This does not have a Target parameter so you''ll have to check F12 specifically like this

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static OldVal As Variant
If Range("F12").Value <> OldVal Then
    OldVal = Range("F12").Value
    '
    'your code here
    '
End If
End Sub
 
Upvote 0
Hi Andrew - the challenge is that I'm using a different worksheet to record the precedent cells with constants (I assume you're referring to the TRUE/FALSE component of the Check Box). Therefore when the box is checked on Sheet1 it sets Sheet2 A1 to TRUE which does not trigger my Worksheet Change event on Sheet1 to fire. If that made any sense.
 
Upvote 0
I've tried that as well however because the code I'm calling inside the event is an advanced filter is requires the appropriate sheet to be selected...somewhat laborious.

I've used VoG's suggestion and it works perfectly. Thanks so much for the help guys!
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top