ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Controlling ComboBox from VBA-script (https://www.excelbanter.com/excel-programming/389827-controlling-combobox-vba-script.html)

Sören_Marodören[_2_]

Controlling ComboBox from VBA-script
 
Hi,

How can I control the data in a ComboBox without using cells in a worksheet?

Now I have the ListFillRange pointing to cells in my worksheet.
I don't want that. I want to set the value for this from my VBA-script.
Is that possible?
I already use "ComboBox1.Value" to read out its value.

Best regards,
/Sören

NickHK

Controlling ComboBox from VBA-script
 
Sören,

ListBox1.AddItem "Item 1"

NickHK

"Sören_Marodören" wrote in message
...
Hi,

How can I control the data in a ComboBox without using cells in a

worksheet?

Now I have the ListFillRange pointing to cells in my worksheet.
I don't want that. I want to set the value for this from my VBA-script.
Is that possible?
I already use "ComboBox1.Value" to read out its value.

Best regards,
/Sören




Sören_Marodören[_2_]

Controlling ComboBox from VBA-script
 
Hi NickHK,

This does not work for me.
But I tryed something similar:
ComboBox1.List = Array("Alfa", "Beta", "Gamma", "Delta")
and also added a default value with the following line:
ComboBox1.Value = "Gamma"

So now it works for me.

Br,
/Sören

"NickHK" wrote:

Sören,

ListBox1.AddItem "Item 1"

NickHK

"Sören_Marodören" wrote in message
...
Hi,

How can I control the data in a ComboBox without using cells in a

worksheet?

Now I have the ListFillRange pointing to cells in my worksheet.
I don't want that. I want to set the value for this from my VBA-script.
Is that possible?
I already use "ComboBox1.Value" to read out its value.

Best regards,
/Sören






All times are GMT +1. The time now is 02:16 PM.

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