+ Reply to Thread
Results 1 to 5 of 5

User for to query/extract data?

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    8

    User for to query/extract data?

    Hi folks,

    I'm new here and apologize if I'm doing this wrong (not sure if there is something I'm supposed to do before posting a question) but here is my problem.

    I have a user form with three comboboxes - already filled in (the drop down has the necessary data from another tab in it). There's a command button labeled "search" on the userform. I'd like it to, based on the data in the combo boxes, extract and paste into a new workbook. The data matching columns are C, H and M.

    For example (sorry if I'm overexplaining), C is the state, H is the color and M is the model number. I would also like there to be an "ALL" option in the drop down, so one could choose the country and select ALL colors and ALL model numbers. Does this make sense?

    I've been trying for weeks get this right. Any help would be appreciated. BTW, I'm using 2010 version.

    Thanks in advance.

    EDIT: Sorry for the mispellings (title).
    Last edited by JKoo1; 03-19-2013 at 12:49 PM.

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: User for to query/extract data?

    Hi,
    Post a sample file with data , which would help the forum users to offer a possible solution for your needs.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Registered User
    Join Date
    03-19-2013
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: User for to query/extract data?

    Good idea. I'll post the file when I can, but here is the code I'm working with (I'm a beginner, which should be obvious). The userform has three comboboxes (the state, car and color).


    Private Sub CommandButton1_Click()
    State = Sheet1.Range("H")
    Car = Sheet1.Range("C")
    Color = Sheet1.Range("M")
    Dim TheAnswer As String
    Dim workign As Worksheet, dumping As Workbook
    Set workign = ActiveSheet
    Set dumping = Workbooks.Add
    For x = 1 To 17
    working.rows(x).EntireRow.copy
    dumping.Activate
    ActiveSheet.Paste
    ActiveCell.Offset(1).Select
    Next
    For x = 1 To workign.Cells.SpecialCells(x1Cells(x1CellTypeLastC ell).Row
    If LCase$(working.Cells(x,8).Value) = TheAnswer Then
    dumping.Activate
    ActiveSheet.Paste
    ActiveCell.Offset(1).Select
    End If
    Next
    End Sub

  4. #4
    Registered User
    Join Date
    03-19-2013
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: User for to query/extract data?

    Ok, I take it that's not enough. I'll try and post an example. It's obvious something is wrong with the front half of the code though...I just don't know what.

  5. #5
    Registered User
    Join Date
    03-19-2013
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: User for to query/extract data?

    Can't seem to upload. Anywho, I think the problem is with the first part of this (linking the comboboxes to the columns in order to pull the data). I tried this...

    Private Sub CommandButton1_Click()
    ComboBox1.RowSource = .Range("H")
    ComboBox2.RowSource = .Ramge("C")
    ComboBox3.RowSource =.Range("M"),_

    But its still not working.

+ 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