• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Possible combination Excel VBA

I have 5 listboxes. All Listboxes contains a fields Called "All".

There is a code in Excel VBA if Listbox is not selected as "All" then following code will execute.
Code:
If i10.Range("A"& j)= ary(UBound(ary))And i10.Range("B"& j).Value = ary1(UBound(ary1))And i10.Range("G"& j)= ary2(UBound(ary2))And i10.Range("C"& j)= ary3(UBound(ary3))And i10.Range("E"& j)= ary4(UBound(ary4))Then
d = d +1
e.Rows(d).Value = i10.Rows(j).Value
EndIf
But if any of the listbox is selected "ALL" item. for example then i need to change = sign to <> for example : if listbox1 selected "All" then i10.Range("A" & j) <> ary(UBound(ary)) I want all possible combinations.
 
Hi Rajesh ,

I am finding it difficult to understand your code ; can you explain all that you wish to do ? If that is done , I'll write the required code to do it.

Narayan
 
Rajesh,
Posting the file with a set of data may make it easier to understand
 
Sure Narayan and Hui.

I have attached my file. Here is the steps:

1. I have few datas in Data sheet. (This is PL Report, which is updating daily)
2. In home sheet, I have 5 List boxes. Based on the selection from Listboxes i need to copy row from Data sheet to Home sheet.
3. I have added new item called "ALL" in list boxes reason is if user selected ALL means it has to pull all data of that list box.

3 Option is not working,

Please Check my file.
 

Attachments

  • PL.xls
    79 KB · Views: 1
Hi Rajesh ,

See this file.

The whole exercise can be done in a more elegant way if you use the Advanced Filter.

Narayan
 

Attachments

  • PL.xls
    77.5 KB · Views: 3
Back
Top