Combobox gestione di piu dati



  • Combobox - gestione di più dat
    di Luca (utente non iscritto) data: 16/06/2009

    Buon pomeriggio,
    sto cercando di creare una cella combinata (combobox) dove il range di provvenienza dei dati è funzione di due condizioni legate ad altre due scelte.
    e' possibile, in maniera semplice, fare questa procedura?
    fino ad ieri mi creavo una lista dati dinamica che variava in base alle condizioni di qui anticipato (praticamente utilizzando per ogni riga della lista la funzione se), ma al momento devo realizzare una struttura più complessa e facendo in questo modo non finirei più...
    mi potete consigliare?
    vi ringrazio anticipatamente
    luca

    ps: vi allego il codice vba che ho scritto associato alla combobox, in pratica in base alle due scelte iniziali, le due celle h37 ed h38 nel foglio bd2(2) cambiano valore e quindi deve cambiarmi la lista di dati.
     
    Private Sub ComboBox1_Change()
    If Range("BD2(2)!H37") = 1 And Range("BD2(2)!H38") = 1 Then
    ComboBox1.ListFillRange = ("BD2(2)!H563:H580")
    End If
    If Range("BD2(2)!H37") = 1 And Range("BD2(2)!H38") = 2 Then
    ComboBox1.ListFillRange = ("BD2(2)!H582")
    End If
    If Range("BD2(2)!H37") = 1 And Range("BD2(2)!H38") = 3 Then
    ComboBox1.ListFillRange = ("BD2(2)!H584:H586")
    End If
    If Range("BD2(2)!H37") = 1 And Range("BD2(2)!H38") = 5 Then
    ComboBox1.ListFillRange = ("BD2(2)!H588:H592")
    End If
    If Range("BD2(2)!H37") = 1 And Range("BD2(2)!H38") = 8 Then
    ComboBox1.ListFillRange = ("BD2(2)!H594:H595")
    End If
    If Range("BD2(2)!H37") = 2 And Range("BD2(2)!H38") = 2 Then
    ComboBox1.ListFillRange = ("BD2(2)!H597:H599")
    End If
    If Range("BD2(2)!H37") = 2 And Range("BD2(2)!H38") = 3 Then
    ComboBox1.ListFillRange = ("BD2(2)!H601:H604")
    End If
    If Range("BD2(2)!H37") = 2 And Range("BD2(2)!H38") = 4 Then
    ComboBox1.ListFillRange = ("BD2(2)!H606:H607")
    End If
    If Range("BD2(2)!H37") = 2 And Range("BD2(2)!H38") = 5 Then
    ComboBox1.ListFillRange = ("BD2(2)!H609:H619")
    End If
    If Range("BD2(2)!H37") = 2 And Range("BD2(2)!H38") = 6 Then
    ComboBox1.ListFillRange = ("BD2(2)!H621:H622")
    End If
    If Range("BD2(2)!H37") = 2 And Range("BD2(2)!H38") = 7 Then
    ComboBox1.ListFillRange = ("BD2(2)!H624:H626")
    End If