[RESOLVED] Excel - Disabled Macros
My spreadsheet needs the macros to work correctly.
Is it possible to use the IF statement in a cell to work out if the macros are disabled or not?
I was thinking of some sort of conditional formatting that would put in big letters "Enable the macros!" if the sheet was open with the macros disabled.
Re: Excel - Disabled Macros
A simple way would be to have that in the cell by default and if macros are enabled then have a small macro to clear that cell. So if no macros are enabled it will be left in the cell so they can read it.
If not i'll look into seeing if there is anyother way.
Re: Excel - Disabled Macros
Backward thinking! I like it! :afrog:
Re: Excel - Disabled Macros
:D My dyslexia is finally paying off.
I couldnt find anything that would help on this. :(
Re: Excel - Disabled Macros
I created a sheet with a big message on it then
On Open I hid it and unhid the other sheets
On Close I hid the other sheets and unhid the message sheet.
That way it looks normal if you enable macros and has only a message if the macros are disabled
VB Code:
Option Explicit
Private Sub Workbook_Open()
'Make the sheets visible if the macros are enabled
Sheets(2).Visible = True
Sheets(3).Visible = True
Sheets(4).Visible = True
'Hide the disabled macro sheet
Sheets(1).Visible = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Show the disabled macro sheet
Sheets(1).Visible = True
'Hide all the proper sheets so that a macro must open them
Sheets(2).Visible = False
Sheets(3).Visible = False
Sheets(4).Visible = False
'Save the workbook
Me.Save
End Sub