+ Reply to Thread
Results 1 to 7 of 7

Hide/Unhide rows with an object

  1. #1
    Registered User
    Join Date
    04-06-2020
    Location
    Melbourne
    MS-Off Ver
    365
    Posts
    20

    Question Hide/Unhide rows with an object

    Hi Guys,

    Hopefully someone can help.

    I'm trying to crease a macro to an object which will hide and unhide set rows. I can get a button to do this, but would much prefer to have an image, which is a down arrow that hides several rows below it.

    It's used to hide details rows under header rows for finance purposes. For example smaller accounts within a large totalling account. My code for the toggle button works and looks as below, but can't seem to adjust it for an object:

    Private Sub ToggleButton1()
    If ToggleButton1 Then
    Rows("12:15").EntireRow.Hidden = True
    Else
    Rows("12:15").EntireRow.Hidden = False
    End If
    End Sub
    Any help is much appreciated.

  2. #2
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Hide/Unhide rows with an object

    you need a cell which is not used, e.g. "A1" in this case
    you can assign a macro to a shape
    Please Login or Register  to view this content.
    cheers
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-06-2020
    Location
    Melbourne
    MS-Off Ver
    365
    Posts
    20

    Re: Hide/Unhide rows with an object

    You are a life saver, worked like a treat.

    Thank you very very much.

  4. #4
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Hide/Unhide rows with an object

    welcome

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Hide/Unhide rows with an object

    You could also do it without helper cells, but have the arrow rotate to show whether it will hide/unhide the rows
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Hide/Unhide rows with an object

    perfect solution !

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Hide/Unhide rows with an object

    Thanks.
    Not necessarily any better than yours, I just prefer to have the "Button" change to show what it's going to do.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to Hide rows with zeros in column E5:E50, then Unhide all rows
    By aaron061883 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-30-2019, 01:53 AM
  2. VBA hide/unhide rows containing 0's
    By donjamin in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-27-2017, 09:16 AM
  3. [SOLVED] Macro for Hide blank rows and Unhide the rows with cells
    By Neilesh Kumar in forum Excel General
    Replies: 4
    Last Post: 04-12-2017, 06:06 AM
  4. Need Toggle Button to hide/unhide rows based on cell value in non concurrent rows
    By The Phoenix in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-13-2015, 10:49 AM
  5. [SOLVED] Hide and unhide rows
    By bbarth in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-30-2015, 12:10 PM
  6. [SOLVED] First unhide all rows - then hide rows based on specific cell value for a range of cells
    By robbiekh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-22-2013, 05:46 PM
  7. Hide/Unhide with auto-changing object
    By BRISBANEBOB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-06-2009, 12:49 AM

Tags for this Thread

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