ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   userform syntax (https://www.excelbanter.com/excel-programming/305805-userform-syntax.html)

newbie

userform syntax
 
I'm trying to clear all comboboxes in one hit.

For Each ComboBox In UserForm1
.Value = ""
Next

... would be great - if it worked!
Can someone please help me wit h the syntax?
TIA

papou[_9_]

userform syntax
 
For Each cb in UserForm1.Controls
If TypeOf cb Is MSForms.Combobox Then cb.Value = ""
Next cb

HTH
Cordially
Pascal

"Newbie" a écrit dans le message de
...
I'm trying to clear all comboboxes in one hit.

For Each ComboBox In UserForm1
.Value = ""
Next

.. would be great - if it worked!
Can someone please help me wit h the syntax?
TIA




AA2e72E

userform syntax
 
Try:

For Each ComboBox In UserForm1
.Clear
Next



"Newbie" wrote:

I'm trying to clear all comboboxes in one hit.

For Each ComboBox In UserForm1
.Value = ""
Next

.. would be great - if it worked!
Can someone please help me wit h the syntax?
TIA



All times are GMT +1. The time now is 10:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com