Hide & Show Columns Macro

  • 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!!



  • Re: Hide & Show Columns Macro

    Dear Pat,

    Excel macro done not support murged cells for some cases, so please do not use merged cells , your problem will be solved.


    Excel VBA programmer
    Mumbai. India

  • Re: Hide & Show Columns Macro

    Thanks very much, I will try unmerging the cells in the sheet first and then maybe try unprotecting them if necessary (on Monday), of course I will post th results.[hr]*[/hr] Auto Merged Post;[dl]*[/dl]Hi,
    I have unmerged the only merged cells and unprotected all cells in the sheet, and I am still getting the same error, any other suggestions?



Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!