Trigger a Macro in another sheet when a cell is changed

Anthrol

New Member
Joined
Feb 27, 2018
Messages
5
Hi All,

This community has been a big help after my first post, and now I need some assistance with a function I've been trying to solve (I'm losing hair).

I have a sheet with a few tabs, 'MMenu,' and 'Calendar,' and a macro called 'Fourfivedays.' I want this this macro to trigger in 'Calendar' when I change a date value in a cell in 'MMenu.'

I've tried the basic commands in VBA for 'MMenu,' but I have a feeling this needs to ref the sheet 'Calendar' Somehow. The date cell is E6 and so I tried this,

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$6" Then
With Worksheets ("Calendar")
Call Fourfivedays
End With
End If
End Sub

Perhaps I'm waaay off the mark, I've googled for answers and looked in here too but I can't find one. The code seems to be accepted okay but nothing happens. Your help is most appreciated.

Thanks,

Simon
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
I always have problems with target.address, try

if target.column=5 and target.row=6 then
 
Upvote 0
I used this in the end, seems to be a pretty easy way, even though the worksheet briefly flashes. I need to ensure after the cell is updated in MMenu, that the macro is activated in another sheet and the user still remains on the Main Menu. I guess the flash means the code is working.

Sub worksheet_change(ByVal target As Range)
If target.Address = ("$E$6") Then
With Worksheets("Calendar").Activate
Call Fourfivedays
End With
With Worksheets("MMenu").Activate
End With
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,829
Messages
6,121,827
Members
449,051
Latest member
excelquestion515

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