DB73
Board Regular
- Joined
- Jun 7, 2022
- Messages
- 107
- Office Version
- 365
- 2021
- 2019
- 2016
- 2010
- 2007
- Platform
- Windows
- Mobile
- Web
Hi peeps,
is it possible, if yes then how, to populate textboxes and comboboxes with mouse click or double click. from a listbox
for now i have a cmdbttn that populates the tbx en cbx from my listbox.
but i would rather like a mouse bttn click while scrolling trough my listbox, and than populate the txbx and cbx.
listbox is populated by (rowsource ??)
is it possible, if yes then how, to populate textboxes and comboboxes with mouse click or double click. from a listbox
for now i have a cmdbttn that populates the tbx en cbx from my listbox.
but i would rather like a mouse bttn click while scrolling trough my listbox, and than populate the txbx and cbx.
listbox is populated by (rowsource ??)
VBA Code:
Private Sub UserForm_Initialize()
Dim ws1 As Worksheet, rng1 As Range
Set ws1 = Sheets("Dumpstats")
Set rng1 = ws1.Range("A1:BH" & ws1.Range("A" & ws1.Rows.Count).End(xlUp).Row)
With Me.ListBox1
.ColumnHeads = True
.ColumnCount = rng1.Columns.Count
.ColumnWidths = "50;30;00;00;50;00;00;00;30;00;00;00;80;150;00;00;100;100;80;40;40;40;00;60;55;50;00;00;00;00;00;70;150;00;00;00;150;00;00;00;60;60;90;200;85;00;00;00;90;00;00;00;00;150;60;00;00;00;00;00"
'"00;01;02;03;04;05;06;07;08;09;10;11;12; 13;14;15; 16; 17;18;19;20;21;22;23;24;25;26;27;28;29;30;31; 32;33;34;35; 36;37;38;39;40;41;42; 43;44;45;46;47;48;49;50;51;52; 53;54;55;56;57;58;59"
.RowSource = rng1.Parent.Name & "!" & rng1.Resize(rng1.Rows.Count - 1).Offset(1).Address
End With
'add items in comboboxen
ComboBox1.List = Application.Range("werkdag_ziek_verlof").value
ComboBox2.List = Application.Range("projecten").value
ComboBox3.List = Application.Range("adressen").value
ComboBox4.List = Application.Range("normale_uren_over_uren").value
'ComboBox5.List = Application.Range("uur_tarief_percentage").value
'cbx5
Dim cell As Range
For Each cell In Application.Range("uur_tarief_percentage").Cells
ComboBox5.AddItem cell.Text
Next cell
ComboBox6.List = Application.Range("werktijden").value 'tijd in
ComboBox7.List = Application.Range("werktijden").value 'tijd uit
ComboBox8.List = Application.Range("pauze_geen_pauze").value 'pauze
ComboBox9.List = Application.Range("BTW_verlegd").value
'ComboBox10.List = Application.Range("BTW_heffing").value
'cbx10
For Each cell In Application.Range("btw_heffing").Cells
ComboBox10.AddItem cell.value
ComboBox10.Enabled = False
Next cell
'ComboBox11.List = Application.Range("adressen").value
'ComboBox11
With ComboBox11
.ColumnCount = 5
.List = Range("adressen").value
End With
'ComboBox12.List = Application.Range("adressen").value
'ComboBox11
With ComboBox12
.ColumnCount = 5
.List = Range("adressen").value
End With
ComboBox13.List = Application.Range("enkel_retour_rit").value
ComboBox14.List = Application.Range("woon_werk_zakelijk").value
ComboBox15.List = Application.Range("te_declareren_per_km").value
ComboBox16.List = Application.Range("overige_declaratie").value
ComboBox17.List = Application.Range("reden_rit").value
ComboBox18.List = Application.Range("te_declareren_per_km").value
ComboBox19.List = Application.Range("vervoer").value
ComboBox20.List = Application.Range("reden_overige_declaratie").value
End Sub