Userform to query?

J

JonathanK1

Ok, I created a userform with three comboboxes. The drop down has al
of the data I need it to (from another tab), such as states, colors
etc. It's set up so when you click on state, color etc. this data i
pulled into a new workbook (works pretty darn well, thanks in part t
you folks).

Right now it looks like this:

Range ("H:H").Value = Combox1.Text
Range ("C:C").Value = Combox2.Text
Range ("M:M").Value = Combox2.Text

The problem is that in combobox for each of these I have an option fo
"ALL." So for instance, perhaps I want a state but instead of just gree
or purple, I want all the colors instead of having to narrow it down.
However, if I leave it blank adn don't answer that question, it goe
wacky. If I put "ALL" in the combo box drop down, it replaces th
column with "ALL" in the cells. Is there a way to do this, or must yo
pick a drop down/color etc.?

Does this make sense? Thanks
 
J

JonathanK1

Ok, here is what I have for the "search" button on the user form...

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(x1CellTypeLastCell).Row
If LCase$(working.Cells(x,8).Value) = TheAnswer Then
dumping.Activate
ActiveSheet.Paste
ActiveCell.Offset(1).Select
End If
Next
End Su
 
G

GS

Ok, here is what I have for the "search" button on the user form...
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(x1CellTypeLastCell).Row If
LCase$(working.Cells(x,8).Value) = TheAnswer Then dumping.Activate
ActiveSheet.Paste
ActiveCell.Offset(1).Select
End If
Next
End Sub

Are you offering this as the solution to this thread? This appears to
be doing similar to what you were looking for help with in your Feb
26th post under to subject "Input, copy, new book?"! I posted a rework
of your code sample there on Mar 18th. Did you read it yet?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
J

JonathanK1

Private Sub CommandButton1_Click()
ComboBox1.RowSource = "H"
ComboBox2.RowSource = "C"
ComboBox3.RowSource = "M"

I tried this...but it's another error
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top