Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default add items to combo box

I feel like I should be able to work this one out, but havn't been able to.
I know I can add item to a combo box useing .additem, but I can't figure out
how to link the combo box to a cell range ie A1:A10.

I have been trying to figure it out using vb help and looking at other posts
but have not had much success.

not sure if I am on the right track, but I have been fidling with
..rowsourcce and .controlsource.

any help is greatly appreciated

Melissa
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default add items to combo box

I think I just worked it out about 60 seconds after placing the post. I was
on the right track.

not sure if it is the best way, but I have used:

..rowsource to link the the source data
..columncount to make sure the correct number of rows are displayed
and counta on the sheet to count the number of rows that need to be
displayed, as this will change.
I am now going to link the .columncount and the value from the counta formula.

It looks like this is going to work.

"beauty_bobaloo" wrote:

I feel like I should be able to work this one out, but havn't been able to.
I know I can add item to a combo box useing .additem, but I can't figure out
how to link the combo box to a cell range ie A1:A10.

I have been trying to figure it out using vb help and looking at other posts
but have not had much success.

not sure if I am on the right track, but I have been fidling with
.rowsourcce and .controlsource.

any help is greatly appreciated

Melissa

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default add items to combo box

Ok I have it working great now exept that I want to be able to change the
source range when the range changes. I havn't been able to do that how I
thought I could.

This part isn't that important, but if anyone out there knows how to do it,
I would sure appreciate knowing also.

thankyou

melissa

"beauty_bobaloo" wrote:

I think I just worked it out about 60 seconds after placing the post. I was
on the right track.

not sure if it is the best way, but I have used:

.rowsource to link the the source data
.columncount to make sure the correct number of rows are displayed
and counta on the sheet to count the number of rows that need to be
displayed, as this will change.
I am now going to link the .columncount and the value from the counta formula.

It looks like this is going to work.

"beauty_bobaloo" wrote:

I feel like I should be able to work this one out, but havn't been able to.
I know I can add item to a combo box useing .additem, but I can't figure out
how to link the combo box to a cell range ie A1:A10.

I have been trying to figure it out using vb help and looking at other posts
but have not had much success.

not sure if I am on the right track, but I have been fidling with
.rowsourcce and .controlsource.

any help is greatly appreciated

Melissa

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default add items to combo box

columncount has nothing to do with the number of rows, so hard to say.

You could use a defined name
Insert=Name=Define
Name: List1
Refersto: =Offset(sheet1!$A$1,0,0,CountA(Sheet1!A:A),4)

then
Private Sub Userform_Initialize()
Userform1.Listbox1.RowSource = "List1"
Userform1.ListBox1.columncount = 4
end sub

--
Regards,
Tom Ogilvy


"beauty_bobaloo" wrote:

Ok I have it working great now exept that I want to be able to change the
source range when the range changes. I havn't been able to do that how I
thought I could.

This part isn't that important, but if anyone out there knows how to do it,
I would sure appreciate knowing also.

thankyou

melissa

"beauty_bobaloo" wrote:

I think I just worked it out about 60 seconds after placing the post. I was
on the right track.

not sure if it is the best way, but I have used:

.rowsource to link the the source data
.columncount to make sure the correct number of rows are displayed
and counta on the sheet to count the number of rows that need to be
displayed, as this will change.
I am now going to link the .columncount and the value from the counta formula.

It looks like this is going to work.

"beauty_bobaloo" wrote:

I feel like I should be able to work this one out, but havn't been able to.
I know I can add item to a combo box useing .additem, but I can't figure out
how to link the combo box to a cell range ie A1:A10.

I have been trying to figure it out using vb help and looking at other posts
but have not had much success.

not sure if I am on the right track, but I have been fidling with
.rowsourcce and .controlsource.

any help is greatly appreciated

Melissa

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default add items to combo box

Thanks mate, worked like a charm!

I still don't totally understand columncount, but I don't need it anyway in
this situation as you poined out.

I guess I'll go do some reading to find out what it is and when to use it

thanks again,

Melissa

"Tom Ogilvy" wrote:

columncount has nothing to do with the number of rows, so hard to say.

You could use a defined name
Insert=Name=Define
Name: List1
Refersto: =Offset(sheet1!$A$1,0,0,CountA(Sheet1!A:A),4)

then
Private Sub Userform_Initialize()
Userform1.Listbox1.RowSource = "List1"
Userform1.ListBox1.columncount = 4
end sub

--
Regards,
Tom Ogilvy


"beauty_bobaloo" wrote:

Ok I have it working great now exept that I want to be able to change the
source range when the range changes. I havn't been able to do that how I
thought I could.

This part isn't that important, but if anyone out there knows how to do it,
I would sure appreciate knowing also.

thankyou

melissa

"beauty_bobaloo" wrote:

I think I just worked it out about 60 seconds after placing the post. I was
on the right track.

not sure if it is the best way, but I have used:

.rowsource to link the the source data
.columncount to make sure the correct number of rows are displayed
and counta on the sheet to count the number of rows that need to be
displayed, as this will change.
I am now going to link the .columncount and the value from the counta formula.

It looks like this is going to work.

"beauty_bobaloo" wrote:

I feel like I should be able to work this one out, but havn't been able to.
I know I can add item to a combo box useing .additem, but I can't figure out
how to link the combo box to a cell range ie A1:A10.

I have been trying to figure it out using vb help and looking at other posts
but have not had much success.

not sure if I am on the right track, but I have been fidling with
.rowsourcce and .controlsource.

any help is greatly appreciated

Melissa

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding items to a combo box on a user form Gazz_85[_2_] Excel Discussion (Misc queries) 1 July 9th 09 05:00 PM
Add items to a combo box and make them available after closing the sheet [email protected] Excel Discussion (Misc queries) 1 June 25th 07 09:42 PM
View List Items in Combo Box rl Excel Worksheet Functions 6 May 17th 07 12:53 AM
Combo Box Losing List Items InnerChild Excel Programming 1 June 24th 04 11:13 PM
Different colors for combo items Malcolm Excel Programming 1 November 6th 03 12:26 PM


All times are GMT +1. The time now is 03:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"