good morning,
Question:It is an possiblity to protect comboboxes, to become uneditable, but still to have the drop down list?
thx
good morning,
Question:It is an possiblity to protect comboboxes, to become uneditable, but still to have the drop down list?
thx
Change the .Style property to fmStyleDropDownList
thx for answer. now if the following error:
Could not set the Value propriety. Invalid property value. (logic because)
ComboBox9.Value = Rng(11) .. how can I put an logical statement that can initzialized the first value from combobox list if the value is not equal or is missing
Hi white_flag,
I am afraid that your question is not making sense to me. Please attach a small example workbook with the combobox and the code as is; that is, to show how you are currently trying to add value(s) to it, and from whence the vals came.
Thanks,
Mark
correct ..mia culpa.
Please look in attach. It talks better then me.
Hi there,
I doubt that I'll be of much help, but if I can be a little help, and one of the guys can come by and rescue us, that would be great. Here is what I observed:
Originally Posted by white_flag
I do not see the above anywhere in the code. That said, I did find where the value of ComboBox9 was (attempted) assigned to "Rng(11)".
Presuming that you included all the code, I do not see where 'Rng()' is declared or sized?
I am afraid that with not understanding how the array could work at this point, this part is just beyond me :-(Originally Posted by white_flag
I hope you get some great help, or can say whether CommandButton12 (click) runs for you if there is missing code or something that I am just not getting. The userform seems very neat to me; I really like how you have it changing languages!
Sorry I cannot help thus far,
Mark
thx, Mark
for me I would like to put an deviation from error.
Like: if error, initialized combobox with first value from list ..etc
I think you need to find the item in the Combo and change the ListIndex to suit
Private Sub ListBox1_Click() Insul = ListBox1 Set Rng = Rows(2).Find(Insul, LookAt:=xlWhole).resize(1) TextBox1.Value = Rng(1) 'name TextBox2.Value = Rng(2) 'diametru TextBox4.Value = Rng(3) 'Lenght Body ComboBox6.Text = Rng(4) 'Insulation Body ComboBox7.Value = Rng(5) 'tk Insulation Body TextBox9.Text = Rng(6) 'Layer Insulation Body ComboBox8.Text = Rng(10) 'Type Sheeting Body 'Change here ComboBox9.ListIndex = LIndex(ComboBox9, Rng(11)) 'tk Sheeting Body '............ Function LIndex(Ctrl As Control, v) Dim i As Long For i = 0 To Ctrl.ListCount If v = --Ctrl.List(i) Then LIndex = I Exit Function End If Next End Function
Last edited by Aussiebear; 04-19-2023 at 12:08 AM. Reason: Adjusted the code tags
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
with: If v = --Ctrl.List(i) Then I have this error: Error 13 - Type mismatch
with: If v = Ctrl.List(i) Then I have this error: Error 381 - Could not get the list property. invalid property array index
The values in the combos and theRng(11) etc. need to be comparable.
-- was to convert 0.6 string to numerical. You may need to play around with these to get it to work.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
ok thx ..but before you go from this thread. I have one more question that you help me in an different thread. how can I delete the first two rows from the listbox without having an error. Like this to have an empty file without any data inserted in worksheet
Read the items into an array, clear the box then add them back, omitting the first two.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
ok ..I am so lost ..can you be more precise? I would like to fix this alone, but I can not ..
Sub LoseFirst() Call NewList(ComboBox9, 2) End Sub Sub NewList(Ctrl As Control, ToLose As Long) Dim i As Long Dim arr() ReDim arr(Ctrl.ListCount - ToLose - 1) For i = 0 To Ctrl.ListCount - ToLose - 1 arr(i) = Ctrl.List(i + ToLose) Next Ctrl.Clear Ctrl.List() = arr End Sub
Last edited by Aussiebear; 04-19-2023 at 12:09 AM. Reason: Adjusted the code tags
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
thx for help ..but this is to much for me.I have to search for an simple solution
in attachment is an simplify version ..maybe someone will help me
.. I would like here a bit of magic ..
good evening
I need your help if it is possible.
I change the "tactic" but I am stuck (again). I change the list box in listview. now, I do not know how to delete an filed or to edit an field and initialized an listview. I would appreciated any help. thank you (please look in attachment).