ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA Form Combo Box question. (https://www.excelbanter.com/excel-discussion-misc-queries/15143-vba-form-combo-box-question.html)

WTG

VBA Form Combo Box question.
 
Help !!!

I know this is most likely a simple question, but I'm stuck :(

I not to populate a Combo box in an Excel spread sheet I just enter
the location in the ListFillRange (EmpData!A1:A100).

But I got creative and tryed making a Userform with VBA.
Now I'm lost :(

In VBA the combo box doesn't have a ListFillRange....

One place I read to enter the location in the ControlSource field, but
it doesn't take the information. It keeps giving me an error message.

Can anyone Help Please?

Thanks

Wally






Bob Phillips

See response in worksheetfunctions.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"WTG" wrote in message
...
Help !!!

I know this is most likely a simple question, but I'm stuck :(

I not to populate a Combo box in an Excel spread sheet I just enter
the location in the ListFillRange (EmpData!A1:A100).

But I got creative and tryed making a Userform with VBA.
Now I'm lost :(

In VBA the combo box doesn't have a ListFillRange....

One place I read to enter the location in the ControlSource field, but
it doesn't take the information. It keeps giving me an error message.

Can anyone Help Please?

Thanks

Wally








Dave Peterson

But it has a .rowsource property that you can use.

In fact, you can use it in code, too:

Option Explicit
Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource _
= Worksheets("sheet1").Range("a1:a10").Address(exter nal:=True)
End Sub



WTG wrote:

Help !!!

I know this is most likely a simple question, but I'm stuck :(

I not to populate a Combo box in an Excel spread sheet I just enter
the location in the ListFillRange (EmpData!A1:A100).

But I got creative and tryed making a Userform with VBA.
Now I'm lost :(

In VBA the combo box doesn't have a ListFillRange....

One place I read to enter the location in the ControlSource field, but
it doesn't take the information. It keeps giving me an error message.

Can anyone Help Please?

Thanks

Wally


--

Dave Peterson

Tom Ogilvy

Just to add, ControlSource is the equivalent of LinkedCell

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote in message
...
But it has a .rowsource property that you can use.

In fact, you can use it in code, too:

Option Explicit
Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource _
= Worksheets("sheet1").Range("a1:a10").Address(exter nal:=True)
End Sub



WTG wrote:

Help !!!

I know this is most likely a simple question, but I'm stuck :(

I not to populate a Combo box in an Excel spread sheet I just enter
the location in the ListFillRange (EmpData!A1:A100).

But I got creative and tryed making a Userform with VBA.
Now I'm lost :(

In VBA the combo box doesn't have a ListFillRange....

One place I read to enter the location in the ControlSource field, but
it doesn't take the information. It keeps giving me an error message.

Can anyone Help Please?

Thanks

Wally


--

Dave Peterson





All times are GMT +1. The time now is 04:38 AM.

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