Posts by ahmad123

    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
    ahmad123 [Blocked Image: http://www.excelforum.com/images/styles/Skylight/statusicon/user_online.gif
    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

    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




    [/PT]THANK YOU IN ADVANCE !!

    Re: Pivot tables autofilter


    I am not supposed to touch the pivot table. I have only access to the master table filter and i have to control the data in the pivot table from that master table (sheet 1).

    any new suggestions??

    [INDENT]On sheet 1 i filtered my database on "vendor list". On sheet 2 i created a pivot table in which "vendor list" is set as a field. I wished that if i select and filter out a particular value from "vendor list" in sheet 1 ,the "vendor list" field on sheet 2 will automatically filters out the same value . Is this possible?
    If someone can provide me with the right code i will be veryyyy thankful.

    Thank you for your answers.
    [/INDENT]