Results 1 to 6 of 6

How VB code can unhide/hide rows based on combobox selection?

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    12-22-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & Excel/Access 2007
    Posts
    438

    How VB code can unhide/hide rows based on combobox selection?

    Good morning… I have the code you see below that works but I would like to add to it because the drop down box has multiple choices.
    What I have works… I just don’t know how to add to it. This is what I would like for it to do:

    If “RE” or “Both Non-RE & RE” are selected I would like rows 88:89 & 99:102 to be unhidden

    If “NON-RE” is selected I would like for row 99 to be unhidden

    I am trying to learn… just a slow process.

    Formula: copy to clipboard
    'Collateral type'
    Private Sub ComboBox5_Change()

    Dim Rng As Range

    Rows("91:102").Hidden = 1

    If ComboBox5.Value <> "" And ComboBox5.Value <> "Unsecured" Then
    Set Rng = Range("A91:J102")
    Rng.Resize(1 * ComboBox5.Value + ComboBox5.Value - 1).EntireRow.Hidden = 0
    End If

    End Sub
    Attached Files Attached Files
    Last edited by jgomez; 09-04-2012 at 01:24 PM.

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