+ Reply to Thread
Results 1 to 4 of 4

Show data which rows are not hidden

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-13-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2003
    Posts
    152

    Show data which rows are not hidden

    Hi,

    I have a combo box named 'Drop Down 14', I need this combo box should list the data which rows are not hidden.

    For e.g.:- I have data in row 2 & 3 (Column L) and row 2 is hidden & row 3 is not hidden, I want the combo box should list only row3 data.

    The data are in sheet1.

    Please help.

    Thanks.
    Last edited by gan_xl; 08-13-2013 at 05:18 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Show data which rows are not hidden

    Hi!

    Try this code in the DropButtonClick event of your combo box:
    Private Sub ComboBox1_DropButtonClick()
        Dim i As Long
        Dim startRow
        Dim strCol
        
        'Enter the starting row of your data for the list
        startRow = 1
        'Enter the column letter of the column containing your list data
        strCol = "A"
        
        ComboBox1.Clear
        
        With Worksheets("Sheet1")
            For i = startRow To .Cells(.Rows.Count, strCol).End(xlUp).Row
                If Not .Rows(i).Hidden Then
                    ComboBox1.AddItem .Cells(i, strCol).Value
                End If
            Next i
        End With
    End Sub
    I hope this helps you

  3. #3
    Forum Contributor
    Join Date
    03-13-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2003
    Posts
    152

    Re: Show data which rows are not hidden

    Thanks Ajryan88. It works almost 98%. I am looking in to this to make it 100%. Duplicates is appearing in the list, trying to remove it.

    Thanks again.

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Show data which rows are not hidden

    Hi,

    Try changing
    If Not .Rows(i).Hidden Then
        ComboBox1.AddItem .Cells(i, strCol).Value
    End If
    to
    If Not .Rows(i).Hidden Then
        blnExist = False
        
        For j = 0 To ComboBox1.ListCount - 1
            If ComboBox1.List(j) = .Cells(i, strCol).Value Then
                blnExist = True
                Exit For
            End If
        Next j
        
        If Not blnExist Then
            ComboBox1.AddItem .Cells(i, strCol).Value
        End If
        
        blnExist = False
    End If
    and you will have to declare the following variables at the top of the code with the rest of the declarations:
    Dim j As Long
    Dim blnExist As Boolean
    Hope this gets it to 100%

+ 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. How to show hidden cells (with data) in graphs
    By dandavis1 in forum Excel General
    Replies: 6
    Last Post: 03-24-2010, 05:54 AM
  2. Not Show Hidden Rows in Column Chart?
    By DCSwearingen in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 06-10-2008, 09:37 AM
  3. Show hidden rows in chart?
    By a94andwi in forum Excel General
    Replies: 3
    Last Post: 03-02-2007, 11:19 AM
  4. Hidden Data to show on the Chart
    By Brisvegaslad in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-12-2005, 04:17 AM
  5. [SOLVED] Copying data without hidden rows.
    By Cube Farmer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-27-2005, 11:06 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