+ Reply to Thread
Results 1 to 12 of 12

Macro to hide rows - Amazon gift card to whoever can help!

  1. #1
    Registered User
    Join Date
    08-15-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2013
    Posts
    5

    Red face Macro to hide rows - Amazon gift card to whoever can help!

    Hi guys,

    I have no experience with Macros or VBA and am looking for a macro (or set of them) that will hide and unhide some rows based on the results of corresponding cells. I have the cell contents set via a "Yes" or "No" drop down box.
    I have attached my spreadsheet that has three worksheets.
    The first worksheet has three columns, one with an identifier, one with the name corresponding to the identifier, and then the "Yes"/"No" dropdown in the third. I have 17 of these unique identifiers with corresponding names and dropdowns organized in rows.
    The second worksheet has some data relating to the unique identifiers. On this worksheet, I want these rows to be hidden when the corresponding identifier's dropdown is changed to "No" on the first worksheet. Also, when it is changed back from "No" to "Yes", I will need the row to be unhidden.
    The third worksheet is the exact same as the second one, except it has some different data but on the same set of identifiers and will need to function exactly as the second worksheet.

    I'd be happy to email a $5 Amazon gift card to anyone that could help.
    I "Googled" for a little bit and see plenty of examples, I just don't exactly know how to implement them.
    Would love to have this resolved within a couple days.

    Thanks so much anyone!
    Attached Files Attached Files
    Last edited by reubank; 08-21-2013 at 06:02 PM.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to hide rows - Amazon gift card to whoever can help!

    Maybe:

    Please Login or Register  to view this content.
    code should go in the Show-Hide sheet code

  3. #3
    Registered User
    Join Date
    08-15-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Macro to hide rows - Amazon gift card to whoever can help!

    John,
    How exactly do I enter this code?
    Do I create a new macro or open visual basic?
    If so, do I just paste that and hit save, or do I have to do anything else?
    My apologies, I just have never used VB or Macros before.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to hide rows - Amazon gift card to whoever can help!

    I notice you have 2013. So I'll do my best to explain. If you do not have a Developer's Tab on your Menus, you will have to Open it. You need to go too Excel Options and select Customize Ribbon from the choices. From there you will see on the Right side of your screen a dropdown list (Customize the Ribbon). Check the Developer. You will be able to access your Visual Basic Editor from this Menu which will now be an option. Once inside the Editor, look on the Left Hand side it will lists VBA Projects. Choose the one with the Workbook name (ExcelHelp - was your sample). Under this Project will be sheet names. Click on the one for "Show-Hide". Again you'll see two Dropdown lists. One the left hand side choose "Worksheet" - On the right hand side choose "Change". That is where you would paste the code. You can copy the lines after the Sub and prior to the End sub, And paste there. I hope I've been clear.

  5. #5
    Forum Contributor
    Join Date
    12-02-2010
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2013, 2016
    Posts
    100

    Re: Macro to hide rows - Amazon gift card to whoever can help!

    Does ALT+F11 still open VBA in Excel 2013? That's how I access it on machines that I don't have the developer tab added yet.

    Hope that helps

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to hide rows - Amazon gift card to whoever can help!

    Quote Originally Posted by DarkF1ame View Post
    Does ALT+F11 still open VBA in Excel 2013? That's how I access it on machines that I don't have the developer tab added yet.

    Hope that helps
    I thought it was probably something that simple, but I admit, I don't have a clue. I hope the op does.

  7. #7
    Registered User
    Join Date
    08-15-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Macro to hide rows - Amazon gift card to whoever can help!

    When I press Alt+F11, where do I paste your code?
    I pasted it after the code that was already in there, clicked save, and then used the drop down buttons and nothing happened.
    Screenshot below of what pops up when I press Alt+F11
    Screenshot.jpg

    Possibly you could enter the code into the ExcelHelp spreadsheet I attached in the original post and save it and attach that?

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to hide rows - Amazon gift card to whoever can help!

    Here. Try this ExcelHelp.xlsm

  9. #9
    Registered User
    Join Date
    08-15-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Macro to hide rows - Amazon gift card to whoever can help!

    Comment removed by OP. See next comment from OP
    Last edited by reubank; 08-21-2013 at 06:03 PM.

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to hide rows - Amazon gift card to whoever can help!

    You're welcome. Glad to help out and thanks for the feedback. Please comply with Forum Rule No. 9.

    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

  11. #11
    Registered User
    Join Date
    08-15-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Macro to hide rows - Amazon gift card to whoever can help!

    Ahh, John, in testing, I actually did notice something wasn't working.
    I can't seem to hide multiple rows at once.
    Example, if I change both "Category 7" and "Category 8" to "No" on the "Show-Hide" worksheet, Category 7 reappears on the other worksheet, while Category 8 is hidden. Thus it seems when I toggle a second category, it untoggles the prior category.
    Ideally, the macro would need to match the identifiers in column 1 on the "Show-Hide" worksheet with the identifiers on the other worksheets to prevent this.

    Any thoughts?

  12. #12
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to hide rows - Amazon gift card to whoever can help!


+ 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: 0
    Last Post: 05-10-2013, 12:04 PM
  2. Xmas Gift Raffle - Need help to create a macro
    By traga2whiskys in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2012, 08:31 AM
  3. Using check boxes to hide and un-hide rows with drop down lists within rows
    By Sparky_Chris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2012, 07:22 AM
  4. Macro to Hide and Unhide Rows but still be able to insert rows
    By majasmi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2011, 09:25 PM
  5. Macro to hide rows
    By ontu78 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2010, 02:03 AM

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