How to stop a macro on opening a workbook

MacroMan007

New Member
Joined
Aug 5, 2005
Messages
35
I have a question on how to stop a macro from executing if a cell is TRUE?

I'll have a check box for the user to select to make the form permanent. So, when re-opening the form at a later time; the date, time and autonumber will not automatically change.

I'm sure this must be possible, but I can't see how to go about doing it. I tried an if statement, but my coding must be wrong.

Thanks in advance and please let me know if you need more information...
 

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
If i understand you correctly, you could have the checkbox place a value in a cell on a sheet with something like...

Code:
Private Sub CheckBox1_Click()

If CheckBox1 = True Then
Sheet1.Range("A1").Value = True
Else
Sheet1.Range("A1").Value = False
End If

End Sub

Then for the code you want to run/not run you could have something like...

Code:
Sub Macro()

If Range("A1") = True Then
'run your desired code
End If

End Sub

Hope this helps
 
Upvote 0
Hi Georgiboy,

Thanks for your help, that worked perfectly! Now, I just have to get them to use the check box.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

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