ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ComboBOx (https://www.excelbanter.com/excel-programming/388781-combobox.html)

Ayo

ComboBOx
 
How do I link data in a range on a worksheet to a ComboBox on a form?

Thanks

JLGWhiz

ComboBOx
 
There are a couple of ways. You can use the AddItem method if your data is
not in contiguous cells or you can use the Properties Window utility in the
Visual Basic Editor to set the RowSource, exmpl: a2:a10. If you use the
RowSource it does not like quotation marks or words like cells or Range, just
the A1 style cell designator.

"Ayo" wrote:

How do I link data in a range on a worksheet to a ComboBox on a form?

Thanks


Ayo

ComboBOx
 
How do I specifiy which sheet the range, a2:a10, is on.

"JLGWhiz" wrote:

There are a couple of ways. You can use the AddItem method if your data is
not in contiguous cells or you can use the Properties Window utility in the
Visual Basic Editor to set the RowSource, exmpl: a2:a10. If you use the
RowSource it does not like quotation marks or words like cells or Range, just
the A1 style cell designator.

"Ayo" wrote:

How do I link data in a range on a worksheet to a ComboBox on a form?

Thanks


MaC

ComboBOx
 
Try: SheetName!a2:a10

Mariusz

How do I specifiy which sheet the range, a2:a10, is on.




Ayo

ComboBOx
 
That didn't work.

"MaC" wrote:

Try: SheetName!a2:a10

Mariusz

How do I specifiy which sheet the range, a2:a10, is on.





MaC

ComboBOx
 
Have you put this in RowSource property in VBA editor?
It works for me, e.g.: Numbers!A1:A3.
BTW - another way is to use named range.

Mariusz

Użytkownik "Ayo" napisał w wiadomości
...
That didn't work.

"MaC" wrote:

Try: SheetName!a2:a10

Mariusz

How do I specifiy which sheet the range, a2:a10, is on.







Ayo

ComboBOx
 
This is what I have in my code, cboSiteID.RowSource = "H2:H1332", but the
range h2:h1332 is on a sheet named MAO Description.

"MaC" wrote:

Have you put this in RowSource property in VBA editor?
It works for me, e.g.: Numbers!A1:A3.
BTW - another way is to use named range.

Mariusz

UÂżytkownik "Ayo" napisaÂł w wiadomoÂści
...
That didn't work.

"MaC" wrote:

Try: SheetName!a2:a10

Mariusz

How do I specifiy which sheet the range, a2:a10, is on.







MaC

ComboBOx
 
Well, I think you can modify it this way:

cboSiteID.RowSource = "MAO!H2:H1332"

Regards
Mariusz

Użytkownik "Ayo" napisał w wiadomości
...
This is what I have in my code, cboSiteID.RowSource = "H2:H1332", but the
range h2:h1332 is on a sheet named MAO Description.

"MaC" wrote:

Have you put this in RowSource property in VBA editor?
It works for me, e.g.: Numbers!A1:A3.
BTW - another way is to use named range.

Mariusz

U?ytkownik "Ayo" napisa3 w wiadomo?ci
...
That didn't work.

"MaC" wrote:

Try: SheetName!a2:a10

Mariusz

How do I specifiy which sheet the range, a2:a10, is on.









MaC

ComboBOx
 
But if your sheet is named "MAO Description" then modify it to:
cboSiteID.RowSource = chr(39) & "MAO Description" & chr(39) & "!H2:H1332"

Regards
Mariusz

Użytkownik "MaC" napisał w wiadomości
...
Well, I think you can modify it this way:

cboSiteID.RowSource = "MAO!H2:H1332"

Regards
Mariusz

Użytkownik "Ayo" napisał w wiadomości
...
This is what I have in my code, cboSiteID.RowSource = "H2:H1332", but the
range h2:h1332 is on a sheet named MAO Description.

"MaC" wrote:

Have you put this in RowSource property in VBA editor?
It works for me, e.g.: Numbers!A1:A3.
BTW - another way is to use named range.

Mariusz

U?ytkownik "Ayo" napisa3 w wiadomo?ci
...
That didn't work.

"MaC" wrote:

Try: SheetName!a2:a10

Mariusz

How do I specifiy which sheet the range, a2:a10, is on.











Ayo

ComboBOx
 
Still not working. I am not getting any errors but nothing is showing up in
the combobox.

"MaC" wrote:

Well, I think you can modify it this way:

cboSiteID.RowSource = "MAO!H2:H1332"

Regards
Mariusz

UÂżytkownik "Ayo" napisaÂł w wiadomoÂści
...
This is what I have in my code, cboSiteID.RowSource = "H2:H1332", but the
range h2:h1332 is on a sheet named MAO Description.

"MaC" wrote:

Have you put this in RowSource property in VBA editor?
It works for me, e.g.: Numbers!A1:A3.
BTW - another way is to use named range.

Mariusz

U?ytkownik "Ayo" napisa3 w wiadomo?ci
...
That didn't work.

"MaC" wrote:

Try: SheetName!a2:a10

Mariusz

How do I specifiy which sheet the range, a2:a10, is on.










MaC

ComboBOx
 
That's right. As I sad after that tip, if then name of sheet sounds "MAO
Description", rebuild your code to:

cboSiteID.RowSource = chr(39) & "MAO Description" & chr(39) & "!H2:H1332"

Regards
Mariusz

Użytkownik "Ayo" napisał w wiadomości
...
Still not working. I am not getting any errors but nothing is showing up
in
the combobox.

"MaC" wrote:

Well, I think you can modify it this way:

cboSiteID.RowSource = "MAO!H2:H1332"

Regards
Mariusz

U?ytkownik "Ayo" napisa3 w wiadomo?ci
...
This is what I have in my code, cboSiteID.RowSource = "H2:H1332", but
the
range h2:h1332 is on a sheet named MAO Description.

"MaC" wrote:

Have you put this in RowSource property in VBA editor?
It works for me, e.g.: Numbers!A1:A3.
BTW - another way is to use named range.

Mariusz

U?ytkownik "Ayo" napisa3 w wiadomo?ci
...
That didn't work.

"MaC" wrote:

Try: SheetName!a2:a10

Mariusz

How do I specifiy which sheet the range, a2:a10, is on.













All times are GMT +1. The time now is 05:19 PM.

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