Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Particular Userform (2000 r s1)

    How can to show into userform CONTROLLO_UCASE into combobox1 the value into sheet CODICI in this mode:
    If i select from cboPeriodicita the value 01-GIORNALIERA show into combobox1 only the value refered this index... in this case show into combobox1:
    (is a joint from column A &"-" &column [img]/forums/images/smilies/cool.gif[/img]
    SK-4001-MESSAGGI SWIFT IN PARTENZA
    SK-4002-MESSAGGI SWIFT IN ARRIVO
    SK-6001-OPERAZ.IN DERIVATI(SEGN.PERD.)

    after i click on ELABORA (cmdElabora) store the first 7 characters of item selected (for example SK-4001) int a var named "SK" for the next use...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Particular Userform (2000 r s1)

    Add the following procedure to the userform module:
    <code>
    Private Sub ResetDescrizione()
    Dim lngRow As Long
    Dim strVal As String
    strVal = Left(Me.cboPeriodicita.Value, 2)
    Me.ComboBox1.Clear
    For lngRow = 2 To Range("A65536").End(xlUp).Row
    If Range("C" & lngRow) = strVal Then
    Me.ComboBox1.AddItem Range("A" & lngRow) & _
    "-" & Range("B" & lngRow)
    End If
    Next lngRow
    End Sub
    </code>
    Call ResetDescrizione in the On Change event of cboPeriodicita:
    <code>
    Private Sub cboPeriodicita_Change()
    If mIgnoreEvents Then Exit Sub
    ResetMese
    ResetDescrizione
    End Sub
    </code>
    Add this line to the cmdElabora_Click:
    <code>
    SK = Left(Me.ComboBox1, 7)
    </code>
    Note: you must define a global variable SK in VARIABILI_GLOBALI:
    <code>
    Public SK As String</code>

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Particular Userform (2000 r s1)

    Great!
    Is possible to auto fill the cbox1 with the first available value refred cboPeriodicita...

    Example:

    if select into cboPeriodicita 04-DECADALE, naturally my intention is to fill the cbox1 with the refered value of 04-DECADALE
    in this case auto fill the cbox1 with SK-2001-CDI-CONTROLLO SALDI CONTABILI

    SK-2001-CDI-CONTROLLO SALDI CONTABILI
    SK-2002-C.D.T.-DEBITORI DIVERSI
    SK-6002-OPERAZIONI IN DERIVATI



    if select into cboPeriodicita 08-TRIMESTRALE, naturally my intention is to fill the cbox1 with the refered value of 08-TRIMESTRALE, in this case auto fill the cbox1 with SK-1003-PARTITARI DIVERSI

    SK-1003-PARTITARI DIVERSI
    SK-1004-INCASSI DA CONCESSIONARI
    SK-1005-ANTIRICICLAGGIO (L.197/1991)
    SK-1006-RIMANENZA DI CASSA
    SK-2006-CHIUSURE ORDIN. E PERIOD.CONTI
    SK-2007-L.108/1996-DISP.MATERIA USURA
    SK-2008-GEST.POS.PROBL.ABOLITO 10/3/05
    SK-4003-CONTI IN VALUTA ESTERA
    SK-6003-GESTIONE RAPPORTI TITOLI
    SK-6004-GEST.ORD.SU STRUM.FINANZIARI

    ecc...

    attached last file

    Note:
    In declare var i use GLOBAL why u use PUBLIC? is the same?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Particular Userform (2000 r s1)

    > In declare var i use GLOBAL why u use PUBLIC? is the same?

    "Global" and "Public" have the same meaning. Public is the "official" VBA keyword, but Global is available for compatibility with other versions of BASIC.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Particular Userform (2000 r s1)

    You already know how to make a combo box display its first list entry - see the code in ResetDate and ResetMese.

  6. #6
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Particular Userform (2000 r s1)

    tks... but this code naturally not is of mine "Mnind"...is from a friend as you, and have difficult to modify..

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Particular Userform (2000 r s1)

    See your recent question <post:=545,171>post 545,171</post:> and my reply.

  8. #8
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Particular Userform (2000 r s1)

    ok!!!!!!!!!!!!!!!!!wow solved!

  9. #9
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Particular Userform (2000 r s1)

    ... here attached my last xls file...
    Now have this big prob (for me naturally)...
    Is possible to select from cbox2 the value and insert into column H of sheet CODICI in thgis mode:
    I select 4500 store into cell H2, i select 4503 store into H3, ecc... make this option until i dont exit from userform...
    Or if you have other solution my really prob is to store in a part of code the value selected from cbox2 the the next use...suggest me, please.
    Tks.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Particular Userform (2000 r s1)

    I'm not sure what you want exactly. You could use a public (global) variable, and set it to the selected item of ComboBox2 in the After Update or On Change event of this combo box. The variable will only list the most recently selected item.
    If you want to keep a complete history of selected items, you can put them in a column in the worksheet (or in a hidden worksheet). You already have many examples of such code.

  11. #11
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Particular Userform (2000 r s1)

    I have choice d this way:
    Private Sub ComboBox2_Change()
    RIGA = Sheets("CODICI").Cells(65536, 8).End(xlUp).Row + 1
    Sheets("CODICI").Range("H" + RIGA) = ComboBox2.Value
    End Sub
    but in inizialize userform the first value into cbox2 is filled from default with 4500 and the event cahnge naturally fill the column H into sheet CODICI...
    I would want to maintain the cbox in inizialize is filled with the first item, how can modify the event into change cbox2?

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Particular Userform (2000 r s1)

    Sorry, I don't understand.

  13. #13
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Particular Userform (2000 r s1)

    Attached is a new version of userform.
    My real prob is for each selection on cbox2 insert value selected into column H.
    Tath is all.
    i have used for test a code in event change of cbox2 but when open the suerform the event change of cbox2 insetrt in h the first value, and i dont wuont that, i would want to decide wich value isert into column H:

  14. #14
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Particular Userform (2000 r s1)

    New version...clear from your "mind" old post
    actuall prob is tath:
    for each selection in combobox1 insert the value selected into listbox 1 and for each selection combobox3 insert the value selected into listbox2

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Particular Userform (2000 r s1)

    Does this do what you want?

    Private Sub ComboBox1_Change()
    Me.ListBox1.AddItem Me.ComboBox1
    End Sub

    and similar for ComboBox3 / ListBox2.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •