Running a Macro Based on cell value

Mahaffey19

New Member
Joined
Jun 21, 2018
Messages
1
So I have a Project that I need to print out and clear a section of text. The print and Clear text is all handled in macro1 but it seems to not work. Cell B19 is a formula that will either supply a 1 or 0 based on what is in column A. I am not sure if this is what is causing the issue of it not working.



Private Sub Worksheet_Change(ByVal Target As Range)
Dim targCell As Range
Set targCell = Worksheets(Sheet1).Range("B19")


If Not Application.Intersect(Target, targCell) Is Nothing Then
If targCell.Value = 1 Then
Call Macro1
End If
End If
End Sub
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Because B19 contains a formula, when B19 changes as the result of one or more of its precedent cells changing, a change_event will not trigger. Consider using a worksheet_calculate event or using a key precedent cell that is changed manually to apply the worksheet_change event code.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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