+ Reply to Thread
Results 1 to 4 of 4

Hiding rows based on content of a cell

  1. #1
    Registered User
    Join Date
    07-20-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Hiding rows based on content of a cell

    Hello Excel Forum,

    I'm rather new to VBA (if you define 'rather new' as 'never touched a line of code before'), so I've likely made some basic oversight here, but any help'd be much appreciated. I'm trying to set up a macro that will automatically hide a number of rows based on the value of a Yes/No selection from a drop down menu. While I can set the rows to hide when a cell is changed manually, I'm having difficulty getting the macro to trigger using a formula. I've tried using the method outlined in this site, but I can't seem to get it to work with both hiding and showing the rows as required.

    The intention behind it is to hide elements of a form that are no longer applicable if an earlier option isn't chosen. Since there's a few such fields, I assume I'll need to assign unique names to the macros?

    This is about the best I've come up with so far but I'm getting Type mismatch errors when I try to run it. As I haven't the faintest idea what it is I'm doing here, I could easily be miles off. A1 is currently set to return a value of 1 if 'Yes' is selected, and 0 if 'No' is chosen.

    Please Login or Register  to view this content.
    Any help would be greatly appreciated.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hiding rows based on content of a cell

    Try:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    07-20-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Hiding rows based on content of a cell

    Brilliant, that's fixed the thing right up.

    Thanks for the help.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hiding rows based on content of a cell

    You're welcome!

+ 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. Replies: 3
    Last Post: 06-25-2013, 01:21 PM
  2. Macros auto hiding of rows depending on cell content
    By nad23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2012, 12:40 PM
  3. Hiding rows on cell content and mandatory fields
    By MagicMan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-08-2011, 06:07 AM
  4. Hiding Rows Based on Cell Content
    By ChristineJ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2009, 03:55 AM
  5. [SOLVED] Hiding rows based on cell content
    By brutus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-14-2005, 11:40 PM

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