Excel 2007 - Recorded Macro Runs only in Design Mode
Helo Experts - I recorded a macro with sheet formatting commands and it would not run unless I activated the design mode. Any idea what's going on?
Cheers, V
Microsoft Excel
Last Comment
Rory Archibald
8/22/2022 - Mon
Rory Archibald
What is the macro, and what is the issue if not in design mode?
NewToVBA
ASKER
Sorry, I was not clear enough. The macro is a simple code with formatting cells, e.g., font, alignment, borders. But, I found what the problem is. The macro works fine when I disable the code
in ThisWorkbook "Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)" .
So, if this is my remedy how can I control it from the formatting macro, ie., disable at the start and enable back when done with formatting?
Cheers, V
NewToVBA
ASKER
"application.enableevents = false" put in the first line and "application.enableevents = true" in last
appears to be working. Is there a side effect of it I should consider?