Gregg Wolin
Member
I am using some VBA to show and hide the visibility of groups of rows and columns, creating an accordion effect. I have a really fast machine but the code below takes between 2.5 and 4 seconds to run.
Does anyone have any ideas how to speed this up?
Code:
Public Sub NavButton_Predev()
Application.ScreenUpdating = False
Columns("f:Ae").Hidden = True
Columns("af:Aq").Hidden = True
Columns("af:Aq").Hidden = True
Columns("as:xfd").Hidden = True
Rows("6:23").Hidden = False
Rows("24:25").Hidden = False
Rows("26:40").Hidden = True 'Hides offsite cost details
Rows("41:42").Hidden = False
Rows("43:66").Hidden = True 'Hides onsite cost details
Rows("41:42").Hidden = False
Rows("43:66").Hidden = True 'Hides onsite cost header
Rows("67:68").Hidden = False
Rows("69:80").Hidden = True 'Hides amenities cost details
Rows("81:82").Hidden = False
Rows("83:92").Hidden = True 'Hides Total details
Rows("93:94").Hidden = False
Rows("95:104").Hidden = True 'Hides Ownership cost details
Rows("105:106").Hidden = False
Rows("107:118").Hidden = True 'Hides HOA Subsidy details
Rows("119:120").Hidden = False
Rows("121:132").Hidden = True 'Hides G&A details
Rows("133:134").Hidden = False
Rows("135:140").Hidden = True 'Hides Contingency details
Rows("141:142").Hidden = False
Rows("143:192").Hidden = True 'Hides Reimbursements details
Columns("af:ag").ColumnWidth = 2
Columns("ah").ColumnWidth = 32
Columns("ai:aj").ColumnWidth = 15
Columns("ak:al").ColumnWidth = 15
Columns("am:am").ColumnWidth = 40
Range("ah11").Select
Application.ScreenUpdating = True
End sub
Does anyone have any ideas how to speed this up?