+ Reply to Thread
Results 1 to 6 of 6

Code for button to toggle row height

  1. #1
    Registered User
    Join Date
    10-01-2011
    Location
    Cudahy, Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    4

    Code for button to toggle row height

    I would like to have a button that toggles the height of a range of rows from its original height to a smaller height and then back again.

    For example:

    Toggle rows 2-4 from a height of 16 to a height of 4 and then back to a height of 16.

    I know how to create the button and paste in the code, I'm just not sure of how to code it. Any help is greatly appreciated.
    Last edited by Bentleywp; 10-03-2011 at 10:22 AM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Code for button to toggle row height

    hi, Bentleywp, increasing row height example:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-01-2011
    Location
    Cudahy, Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Code for button to toggle row height

    Thanks for such a speedy response!

    I'm sorry. I realize I wasn't clear enough. I have inserted a shape that I want the user to click on. Clicking on it would reduce the row height to 4. Clicking on it again would change the row height back to whatever it originally was.

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Code for button to toggle row height

    it's always helpful to provide workbook sample, please check attachment, click on the check box
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Code for button to toggle row height

    Please Login or Register  to view this content.
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    10-01-2011
    Location
    Cudahy, Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Code for button to toggle row height

    Thank you. I'm new to this so I appreciate the suggestion to include a sample. I will make sure I do that next time. Thank you both for your solutions --they showed me two different ways of solving my problem. Great job!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1