Hi,
I have a simple macro that I have been using to hide columns in a very large spreadsheet. Essentially, the user has access to buttons that allow him to choose between a variety of the most commonly used views. For some reason, when I add columns and adjust the code to hide/reveal these columns, I get:
"Run-time error '1004' - Unable to set the Hidden property of the range class"
with the Debugger highlighting the code for "BO:DC". This problem occurs for several of the similar buttons, including toggle buttons, that hide/reveal columns. I am aware that custom views can be created in the drop-down menu, but I wanted to keep these buttons on the sheet as a quick means of moving from view to view and toggling columns between hidden and revealed. Any advice appreciated, thanks!!
Private Sub CBMonographMLA_Click()
Sheets("MLA1").Columns("A:DI").Hidden = False
Sheets("MLA1").Rows("1:6").Hidden = True
Sheets("MLA1").Columns("B:C").Hidden = True
Sheets("MLA1").Columns("F").Hidden = True
Sheets("MLA1").Columns("K:AQ").Hidden = True
Sheets("MLA1").Columns("AS:BG").Hidden = True
Sheets("MLA1").Columns("BI").Hidden = True
Sheets("MLA1").Columns("BK").Hidden = True
Sheets("MLA1").Columns("BM").Hidden = True
Sheets("MLA1").Columns("BO:DC").Hidden = True
Sheets("MLA1").Columns("DK").Hidden = True
Sheets("MLA1").Columns("DM").Hidden = True
Display More
cheers
Pat