+ Reply to Thread
Results 1 to 12 of 12

combobox to search any worksheet and display each data in a listbox.

Hybrid View

  1. #1
    Registered User
    Join Date
    01-16-2014
    Location
    Algiers, Algeria
    MS-Off Ver
    Excel 2003, Excel 2013
    Posts
    33

    Re: combobox to search any worksheet and display each data in a listbox.

    Hello,
    In Your userform Activate Event put:
    Dim Wks As Worksheet
    For Each Wks In ThisWorkbook.Sheets
    Me.ComboBox1.AddItem Wks.Name
    Next
    Under your Combobox Change event put something like this:

    Dim rng As Range
    Me.ListBox1.Clear
    For Each rng In Sheets(Me.ComboBox1.Value).Range("A2:A100").Cells 'Just an example.
    Me.ListBox1.AddItem rng.Value
    Next
    Regards.

  2. #2
    Registered User
    Join Date
    07-14-2015
    Location
    Saudi Arabia
    MS-Off Ver
    2010
    Posts
    7

    Re: combobox to search any worksheet and display each data in a listbox.

    Thank you sir for your prompt reply. Its all working fine but I have a little problem. The listbox is showing a 1 column only like this:

    Date
    Particulars
    OR Reference
    Withdrawal
    Deposit
    Balance

    What I want to show is like this (1 Row, 6 Columns)

    Date Particulars OR Reference Withdrawal Deposit Balance

    And that is also the format that is shown in each worksheet.
    What shall I do to make it like this format in my Listbox.
    Last edited by Marlon1980; 07-18-2015 at 07:12 AM.

  3. #3
    Registered User
    Join Date
    07-14-2015
    Location
    Saudi Arabia
    MS-Off Ver
    2010
    Posts
    7

    Re: combobox to search any worksheet and display each data in a listbox.

    Please see attached image to make it clearly.

    Capture1 is the result of the code that you gave
    Capture2 is the one that I want to show.

    Capture1.PNGCapture2.PNG

    Thanks once again.
    Last edited by Marlon1980; 07-18-2015 at 07:34 AM. Reason: added image attachment

+ 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. Replies: 4
    Last Post: 12-29-2014, 02:46 PM
  2. listbox click to locate and display worksheet data in userform
    By ilmiawan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-15-2014, 08:28 PM
  3. combobox and listbox search engine
    By darkhangelsk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-03-2013, 09:47 AM
  4. Search Data using Combobox Textbox and Listbox
    By Adrastia in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2012, 05:27 AM
  5. Display info in Listbox/Combobox
    By Jakes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2011, 06:50 AM
  6. Select combobox item, display wksheet name in listbox
    By ACOM in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-19-2009, 05:31 PM
  7. vba-Select from combobox,display in listbox
    By ACOM in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2009, 03:46 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