Personal Macro Workbook

Pestomania

Active Member
Joined
May 30, 2018
Messages
292
Office Version
  1. 365
Platform
  1. Windows
I currently have very little experience with Personal Macro Workbook (PMW) . I am working with a Macro that monitors a specific cell and activates when the data changes. The macro is nested under that specific sheet rather than a module and it works perfectly. Only problem is, I would like to move that macro to a PMW and have it only monitor that specific sheet. Below is the code.


HTML:
Private Sub Worksheet_Change(ByVal Target As Range)    If Target.Address = "$C$7" Then        Run resetformatting    End IfEnd Sub

But once this macro is placed into the PMW, it no longer works. How can I make this macro monitor sheet("master") and determine when the cell changes?
 
The problem isn't complicated, we're just not communicating.

The computer says, "OK, cell C7 changed on some sheet in some workbook. Should I run the macro?"

What do you tell it?

It says cell C7 changed on Sheet1. Yes, run the macro. The macro will go through and color code the sheets individually based on the cell value. I unfortunately can't type the code out as it is on my work computer. The macro works great, it just needs to know which cell to watch.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Every workbook will have sheet1 and it will always be named Sheet1.

I'm using sheet1 for simplicity purposes. The true name of that sheet is "Master".
 
Upvote 0
In ThisWorkbook in Personal:

Code:
Dim WithEvents app As Excel.Application

Private Sub Workbook_Open()
  Set app = Application
End Sub

Private Sub app_SheetChange(ByVal Sh As Object, ByVal Target As Range)
  If Sh.Name = "Master" And Target.Address = "$C$7" Then
    ' whatever
  End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,537
Messages
6,125,390
Members
449,222
Latest member
taner zz

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