Hi all,
Is there a way to save a (customized) condition from the list box?
Everytime I want to check certain values, say for values >0, I would like to not have to set it up. I could then just select it from the dropdown list.
Thanks,
BDB
Hi, You could use a select case, Example shown below to select a value in Col "C" based on you listbox selection.
Code:Column(A) ListBox List Greater Than 0 Less Than 0 Equal to 0 Greater Than 10 Less Than 10 Equal to 10Regards MickCode:Private Sub ListBox1_Click() Dim Rng As Range, Dn As Range, Con Set Rng = Range(Range("c1"), Range("c" & Rows.Count).End(xlUp)) For Each Dn In Rng Select Case ListBox1.Value Case Is = "Greater Than 0": If Dn > 0 Then Dn.Select: Exit Sub Case Is = "Equal to 0": If Dn = 0 Then Dn.Select: Exit Sub Case Is = "Greater Than 10": If Dn > 10 Then Dn.Select: Exit Sub Case Is = "Less Than 10": If Dn < 10 Then Dn.Select: Exit Sub Case Is = "Equal to 10": If Dn = 10 Then Dn.Select: Exit Sub End Select Next Dn End Sub
Last edited by MickG; 07-02-2009 at 09:32 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks