+ Reply to Thread
Results 1 to 2 of 2

display multicolumn box

  1. #1
    Alen32
    Guest

    display multicolumn box

    I have one number in cell a5. In cells A10:A250 i have the product numbers.
    I want to find in area A10:a250 all samme numbers as in cell a5 and display
    rows in multicolumn box(usreform) where these numbers are.

    if it is possible I want to display only results from column a,c and f.


  2. #2
    Dick Kusleika
    Guest

    Re: display multicolumn box

    Alen

    Here's an example of how to do that

    Private Sub UserForm_Initialize()

    Dim rFound As Range
    Dim sFirstAdd As String
    Dim rLook As Range
    Dim rValue As Range

    Set rValue = Sheet1.Range("A5")
    Set rLook = Sheet1.Range("A10:A250")
    Me.ListBox1.ColumnCount = 4

    Set rFound = rLook.Find(rValue.Value, , , xlWhole)

    If Not rFound Is Nothing Then
    sFirstAdd = rFound.Address

    Do
    With Me.ListBox1
    .AddItem rFound.Row
    .List(.ListCount - 1, 1) = rFound.Value
    .List(.ListCount - 1, 2) = rFound.Offset(0, 2).Value
    .List(.ListCount - 1, 3) = rFound.Offset(0, 5).Value
    End With

    Set rFound = rLook.FindNext(rFound)
    Loop Until rFound.Address = sFirstAdd
    End If

    End Sub

    For more on the Find method
    http://www.*****-blog.com/archives/2...e-find-method/

    For more on populating mulitcolumn listboxes
    http://www.*****-blog.com/archives/2...stboxcombobox/

    --
    **** Kusleika
    Excel MVP
    Daily Dose of Excel
    www.*****-blog.com

    Alen32 wrote:
    > I have one number in cell a5. In cells A10:A250 i have the product
    > numbers. I want to find in area A10:a250 all samme numbers as in cell
    > a5 and display rows in multicolumn box(usreform) where these numbers
    > are.
    >
    > if it is possible I want to display only results from column a,c and
    > f.




+ 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