+ Reply to Thread
Results 1 to 8 of 8

Macro to automatically hide or unhide rows based on either a value or no value in a cell

  1. #1
    Registered User
    Join Date
    06-05-2013
    Location
    Syracuse, NY
    MS-Off Ver
    Excel 2010
    Posts
    23

    Question Macro to automatically hide or unhide rows based on either a value or no value in a cell

    I have researched the forum, however, I could not find a solution that properly addresses this request.

    I have an estimate spreadsheet that has many data entry sheets and a Summary Sheet.
    The summary sheet auto-populates based on data entered into other sheets.
    There is no work performed on the summary sheet.


    I would like specific rows on the Summary Sheet to be hidden unless there is an actual value greater than "0".
    All rows that contain a value in Column H, will UNHIDE atomatically, based on having a value greater than "0".
    If an existing was previously shown to have a value and then updated to reflect a "0" value or "Blank" value, then it should be hidden again automatically.

    I have attached a sample for reference.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro to automatically hide or unhide rows based on either a value or no value in a ce

    Perhaps something like this?

    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to automatically hide or unhide rows based on either a value or no value in a ce

    Will there be any chance of a negative value?

    Perhaps using an Absolute of the Range.Value would help to capture those.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  4. #4
    Registered User
    Join Date
    06-05-2013
    Location
    Syracuse, NY
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Macro to automatically hide or unhide rows based on either a value or no value in a ce

    Quote Originally Posted by Solus Rankin View Post
    Will there be any chance of a negative value?

    Perhaps using an Absolute of the Range.Value would help to capture those.
    Thanks Solus,
    in this application, there are no negative values, as I will be entering only costs associated with proposed construction. However, I could possibly use the absolute value suggestion for another application.

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro to automatically hide or unhide rows based on either a value or no value in a ce

    What's about post#2?

  6. #6
    Registered User
    Join Date
    06-05-2013
    Location
    Syracuse, NY
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Macro to automatically hide or unhide rows based on either a value or no value in a ce

    Thanks Fotis.
    This works great as intended.
    Since I am a novice with macros, is it possible to make this run continuously or at every "save"? Therefore, I would not have to create a toggle or pull the macro from a list to run the program.

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro to automatically hide or unhide rows based on either a value or no value in a ce

    I think it's better to run every time that you open your workbook.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-05-2013
    Location
    Syracuse, NY
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Macro to automatically hide or unhide rows based on either a value or no value in a ce

    Fotis 1991,
    Thanks for your suggestion.

+ 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. Automatically hide and unhide rows based on value in cell
    By kmham in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-28-2014, 12:03 PM
  2. simple macro to hide or unhide rows based on a cell value
    By Russ Fuquay in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-19-2013, 06:32 PM
  3. Macro to Hide/Unhide Multiple Rows Based on Cell Value
    By mbp727 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2013, 11:12 AM
  4. How Do I Hide/Unhide Rows in Excel based on a cell Value Automatically?
    By mgarcia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-06-2012, 05:20 AM
  5. Replies: 3
    Last Post: 12-05-2011, 11:41 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