Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88111

Excel graphical glitches when moving between sheets with private subs?

$
0
0

I encountered an odd graphical glitch when running private subs on a sheet then using a macro to jump to another sheet with a private sub on it. Basically excel is getting slowed down (the drop down menu's in the ribbons get messed up as well).

IE: Sheet 1 has

Private Sub Worksheet_Deactivate()

Sheets("Sheet1").Visible = False

End Sub

Sheet 2 has the above code as well except Sheet2 would be the one made hidden when deactivating the worksheet.

With a button placed on sheet1 which trigger the following macro

Sub Sheet1_Button1_Click()

Sheets("Sheet2").Visible = True
Sheets("Sheet2").Select

End Sub

For testing purposes I was just using another macro assigned button on sheet2 that jumped back to sheet one and found that caused the issue. Does anyone know what's going on here and how to prevent it? Maybe this is more of a Microsoft issue?

In my original workbook I had a private sub on a "Cost Estimations" sheet that would run some some code to un-hide used lines and re-hide unused lines in a table that was referencing another sheet. Then I had a macro assigned button on that same sheet that would open a normally hidden sheet with some more info on it. The "hidden" sheet had a private sub on it that automatically hide it when the user clicks off of the sheet just like the "Sheet1" in my example. Additionally in the original workbook it was causing all the information from "cost estimations" to display on the "hidden" sheet, but only if calculations were set to automatic. I was however unable to replicate that in my test worksheet.


Viewing all articles
Browse latest Browse all 88111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>