dooormanny78
New Member
- Joined
- Sep 29, 2017
- Messages
- 1
Hello,
I'm very new to the VBA world but was able to get my code to work on every workbook that I manually add it too. The code is really simple to just add message boxes before closing the workbook that serve as reminders to myself.
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545 }p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545 ; min-height: 15.0px}</style>Private Sub Workbook_BeforeClose(Cancel As Boolean)
If MsgBox("Does this have Compensation Information?", vbYesNo) = vbYes Then
If MsgBox("Have you added a password?", vbYesNo) = vbNo Then
Cancel = True
End If
End If
End Sub
My question is there a way to have this code automatically be added to every workbook I download onto my system? For reference I'm using a macbook pro with excel 2016 and access to windows 10 parallels. Any help would be appreciated.
Cheers!
I'm very new to the VBA world but was able to get my code to work on every workbook that I manually add it too. The code is really simple to just add message boxes before closing the workbook that serve as reminders to myself.
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545 }p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545 ; min-height: 15.0px}</style>Private Sub Workbook_BeforeClose(Cancel As Boolean)
If MsgBox("Does this have Compensation Information?", vbYesNo) = vbYes Then
If MsgBox("Have you added a password?", vbYesNo) = vbNo Then
Cancel = True
End If
End If
End Sub
My question is there a way to have this code automatically be added to every workbook I download onto my system? For reference I'm using a macbook pro with excel 2016 and access to windows 10 parallels. Any help would be appreciated.
Cheers!