Results 1 to 4 of 4

Search value in entire sheet and store the found row in arrays and fill listbox with array

Threaded View

VikramD Search value in entire sheet... 10-05-2014, 02:20 AM
protonLeah Re: Search value in entire... 10-05-2014, 02:23 AM
VikramD Re: Search value in entire... 10-05-2014, 10:30 AM
AlphaFrog Re: Search value in entire... 10-05-2014, 11:48 AM
  1. #1
    Registered User
    Join Date
    10-05-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    2

    Search value in entire sheet and store the found row in arrays and fill listbox with array

    Hello, I'm in a last phase of making an userform with multicolumn list box where user can search value in entire database thru input box value and the found row value to be returned in list box, the found results may have multiples to be stored in arrays and return the same in listbox. Could any one help with solution. The Codes are:
    Private Sub CommandButton2_Click()
    ' Clear Listbox of last search results
    Me.ListBox1.Clear
    Dim lb As MSForms.ListBox
    Dim searchstring
    Dim srchArray() As Variant
    Dim lrw As Long, lcol As Long
    Dim rngTarget As Range
    searchstring = InputBox("Enter any of the following criteria to complete your search", "Search")
    Set rngTarget = Worksheets("Dbase")..UsedRange
    ReDim Preserve srchArray(1 To rngTarget.Rows.Count, 1 To rngTarget.Columns.Count)
    With rngTarget
    For lcol = 1 To .Columns.Count
    For lrw = 1 To .Rows.Count
    
    srchArray(lrw, lcol) = rngTarget.Cells(lrw, lcol)
    Next lrw
    Next lcol
    End With
    Set lb = Me.ListBox1
    With lb
    .ColumnCount = 6
    .ColumnWidths = "100;100;30;300;30;80"
    .List() = srchArray
    End With
    End Sub
    Any help will highly appreciated....
    Last edited by VikramD; 10-05-2014 at 02:44 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to store variable data into an array - help on arrays
    By mandukes in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2014, 09:24 AM
  2. Need to search entire sheet and report if found
    By turbo v6 camaro in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-30-2014, 12:17 PM
  3. Store Found values directly in array
    By cgkmal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-15-2011, 04:41 PM
  4. Looking up arrays and returning entire rows if match is found
    By Carlsbergen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2009, 06:18 AM
  5. store sheets listed in listbox in array
    By Orhan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-02-2006, 05:20 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