Helloooo,

I have a multi selction listbox, i need to copy all the values that i selected in this list box into a column in a worksheet :

1- Select all the values from the list
2- Click on a button
3- Unload the listbox and get the selectd values in in column "A"
Is there a way to do so ??

Thanx for any input

#1 [Blocked Image: http://www.excelforum.com/images/styles/Skylight/buttons/reputation.gif] [Blocked Image: http://www.excelforum.com/images/styles/Skylight/buttons/report.gif]
[Blocked Image: http://www.excelforum.com/images/styles/Skylight/statusicon/post_old.gif] Today, 10:39 AM
Registered User
Join Date: 24 May 2011
Location: montreal
MS Office Version:Excel 2003
Posts: 9
[Blocked Image: http://www.excelforum.com/images/styles/Skylight/reputation/reputation_pos.gif]

Listbox multi selection filter
Hi folks,

I have a userform containing a listbox. In this listbox, theres data imported from a column ("Ext Co Visibility Ds") in a big spreadsheet.
What i need to do is to give the user the capability to filter the big spreadsheet by selecting multiple lines in the listbox.

The listbox has to act like a filter for the column "Ext Co Visibility Ds". By filtering that column the user will see the rows corresponding to his selection in the big spreadsheet.

in the attached file they're my file and my code behind.

In sheet2 u will find the button that has to create a listbox, but the problem is when i select options in this listbox, nothing happens !!!

And can u please modify the code so i will be able to make multi selections in the listbox ???

Thanks to the Gurus

## Files

Re: listbox vs filter

hi again,

Can you please explain to me step by step how to "Transfer the list box selection(s) to the criteria cells"

I made a new column in the same sheet cntaining all the criteria cells.

I created a listbox and i chose that column as it input range. When i select any ooption, nothing happens, the data sheet stays intact !!!

Any help ?

Re: listbox vs filter

yeah i kow that theres this option in excel 2007, but :
1- i am using excel 2003
2- i am asked to build a user friendly userform, so the users wont need to go into the big spreadsheet and filter.

I know it could be done in easier ways but thats what is asked from me.

Any suggestions ??

Hi folks,

I have a userform containing a listbox. In this listbox, theres data imported from a column ("vendor list") in a big spreadsheet.
What i need to do is to give the user the capability to filter the big spreadsheet by selecting lines in the listbox.

The listbox has to act like a filter for the column "vendor list". By filtering that column the user will see the rows corresponding to his selection n the big spreadsheet.

Can anybody help me with this. I assume its a small vba code.

Thanks to the Gurus

Re: Optimization VBA code

EDIT: Please use code tags or your topic will be deleted. Thanks.

Here is the code :

PHP

Hi folks,

I have a vba code that uses data from a huge spreadsheet "RAW" (more then 5000 rows and 50 columns) and generate data in another spreadsheet "Burndown (filter)"

This code is taking long long time to be executed, and i need to use it lot of times, so it is not teffecient at all to keep it like this.
Following is my code, and let the gurus play [Blocked Image: http://www.mrexcel.com/forum/images/smilies/icon_wink.gif]

[PT]Sub Month_1()

Sheets("RAW").Select
Dim rawlastline As Integer
Dim i As Integer
Dim x As Integer
Dim cell As Integer

rawlastline = 2
Do While Cells(rawlastline + 1, 1).Value <> ""

rawlastline = rawlastline + 1
Loop

For x = 2 To 13

cell = 0

i = 2
Do Until i = rawlastline
If Sheets("RAW").Rows(i).Hidden = False Then
If Month(Sheets("raw").Cells(i, 2)) = Month(Sheets("Burndown (filter)").Cells(1, x)) Then

cell = cell + 1

Sheets("Burndown (filter)").Select

Cells(7, x).Value = cell

End If
End If

i = i + 1
Loop

Next

For x = 2 To 13

cell = 0

i = 2
Do Until i = rawlastline
If Sheets("RAW").Rows(i).Hidden = False Then
If Sheets("raw").Cells(i, 18) <> "#" Then

If Month(Sheets("raw").Cells(i, 18)) = Month(Sheets("Burndown (filter)").Cells(1, x)) Then

' DoEvents

cell = cell + 1

Sheets("Burndown (filter)").Select

Cells(6, x).Value = cell

End If
End If

End If

i = i + 1
Loop

Next
For x = 2 To 13

i = 2

Do Until i = rawlastline
If Sheets("RAW").Rows(i).Hidden = False Then
Sheets("raw").Select

x = x + 49
Sheets("raw").Select

If Not Cells(i, x).Value = "" Then

If Sheets("raw").Cells(i, x).Value <= 30 And Sheets("raw").Cells(i, x).Value <> 0 Then

'DoEvents

Sheets("Burndown (filter)").Select

x = x - 49

Cells(2, x).Value = Cells(2, x).Value + 1

x = x + 49

ElseIf Sheets("raw").Cells(i, x).Value > 30 And Sheets("raw").Cells(i, x).Value <= 60 Then
Sheets("Burndown (filter)").Select
x = x - 49

Cells(3, x).Value = Cells(3, x).Value + 1

x = x + 49

ElseIf Sheets("raw").Cells(i, x).Value > 60 And Sheets("raw").Cells(i, x).Value <= 90 Then
Sheets("Burndown (filter)").Select
x = x - 49
Cells(4, x).Value = Cells(4, x).Value + 1

x = x + 49
ElseIf Sheets("raw").Cells(i, x).Value > 90 Then
Sheets("Burndown (filter)").Select

x = x - 49
Cells(5, x).Value = Cells(5, x).Value + 1
End If

End If

End If

i = i + 1
If x > 14 Then
x = x - 49
End If

Loop

Next
'Application.ScreenUpdating = True

End Sub
{"ft_lang_label":"__label__en","ft_lang_prob":0.61888623,"math_prob":0.886858,"size":7939,"snap":"2022-40-2023-06","text_gpt3_token_len":2392,"char_repetition_ratio":0.18336484,"word_repetition_ratio":0.55514705,"special_character_ratio":0.30998868,"punctuation_ratio":0.14602804,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9680695,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-01-28T23:09:33Z\",\"WARC-Record-ID\":\"<urn:uuid:1860c055-5901-427c-b9a5-0d4a4cda683e>\",\"Content-Length\":\"104836\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:8a8f6845-1314-4867-8c6f-6e9aa583018d>\",\"WARC-Concurrent-To\":\"<urn:uuid:4149060b-223f-4bf1-a676-4c98eac6b91b>\",\"WARC-IP-Address\":\"104.26.6.95\",\"WARC-Target-URI\":\"https://forum.ozgrid.com/forum/index.php?user-post-list/129595-ahmad123/\",\"WARC-Payload-Digest\":\"sha1:3GKXI27JIBFM6DLWCFJR3JZZWF76R77L\",\"WARC-Block-Digest\":\"sha1:PBF26MEQH5NXS4HK4ZLXEXMBHZKJFVOJ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764499695.59_warc_CC-MAIN-20230128220716-20230129010716-00777.warc.gz\"}"}