+ Reply to Thread
Results 1 to 5 of 5

Hiding A Row

  1. #1
    Dan G.
    Guest

    Hiding A Row

    Hello.

    I am trying to hide a row based on a value in a cell within the row. I
    need this to take place as the sheet re-calculates after a different
    selection is made from the Forms combo-box.

    Not sure why I'm having issues, as this should be pretty
    straightforward.

    Any help would be greatly appreciated.

    Thanks.

    Dan

    *** Sent via Developersdex http://www.developersdex.com ***

  2. #2
    PCLIVE
    Guest

    Re: Hiding A Row

    Dan,

    I'm not sure if you need to reference multiple rows or if it would always be
    the same row that would be hidden. However, you could try something like
    this.
    This is based of the cell contents of A20 being "q" in which row 20 would
    automatically hide.

    If Range("A20").Value = "q" Then Rows(20).EntireRow.Hidden = True Else
    Rows(20).EntireRow.Hidden = False

    For this to work automatically, right-click on the current worksheet at the
    bottom and select View Code. Then click the drop-down to select Worksheet.
    Then verify that the other drop-down is on SelectionChange.

    HTH,
    Paul

    "Dan G." <[email protected]> wrote in message
    news:[email protected]...
    > Hello.
    >
    > I am trying to hide a row based on a value in a cell within the row. I
    > need this to take place as the sheet re-calculates after a different
    > selection is made from the Forms combo-box.
    >
    > Not sure why I'm having issues, as this should be pretty
    > straightforward.
    >
    > Any help would be greatly appreciated.
    >
    > Thanks.
    >
    > Dan
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




  3. #3
    Tom Ogilvy
    Guest

    Re: Hiding A Row

    Dim cell as Range
    rows.Hidden = False
    for each cell in Range("C1:C200")
    if cell.Value = 3 then
    rows(cell.Row).Hidden = True
    exit for
    end if
    Next

    --
    Regards,
    Tom Ogilvy

    "Dan G." <[email protected]> wrote in message
    news:[email protected]...
    > Hello.
    >
    > I am trying to hide a row based on a value in a cell within the row. I
    > need this to take place as the sheet re-calculates after a different
    > selection is made from the Forms combo-box.
    >
    > Not sure why I'm having issues, as this should be pretty
    > straightforward.
    >
    > Any help would be greatly appreciated.
    >
    > Thanks.
    >
    > Dan
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




  4. #4
    Dan G.
    Guest

    Re: Hiding A Row


    I understand the code, and either would suffice. The problem I have is
    having it execute upon a change in the drop-down.

    Currently values re-calculate on the sheet in a series of INDEX
    formulas. If you activate another cell on the sheet it works fine. If
    you only change the drop down box, and don't select another cell, the
    code does not execute.

    What do you recommend?


    *** Sent via Developersdex http://www.developersdex.com ***

  5. #5
    STEVE BELL
    Guest

    Re: Hiding A Row

    You might try using the change event instead of the selection change event.

    Of course some drop downs have their own events and the one to look for
    would most likely be the exit event (or the change event but this one
    activates each
    time a single character is typed into the drop down)

    --
    steveB

    Remove "AYN" from email to respond
    "Dan G." <[email protected]> wrote in message
    news:%[email protected]...
    >
    > I understand the code, and either would suffice. The problem I have is
    > having it execute upon a change in the drop-down.
    >
    > Currently values re-calculate on the sheet in a series of INDEX
    > formulas. If you activate another cell on the sheet it works fine. If
    > you only change the drop down box, and don't select another cell, the
    > code does not execute.
    >
    > What do you recommend?
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




+ 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