Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How do I set the rowsource for a ComboBox for a dynamic list?

I have a ComboBox on a UserForm that relates to a list which is updated every
time the workbook is opened. At the moment, so that I can carry on with
other aspects, I have set the rowSource as follows:-

ComboBox1.RowSource = "A1:B456"

This of course is only temporary and I would appreciate a more permanent
solution.

Many thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I set the rowsource for a ComboBox for a dynamic list?

Just guessing

With Worksheets("Sheet3")
set rng = .Range(.range("A1"),.Range("A1").end(xldown))
End with
rng.Resize(,2)
Combobox1.ColumnCount = 2
Combobox1.RowSource = rng.Address(external:=True)

--
Regards,
Tom Ogilvy

"ndm berry" wrote in message
...
I have a ComboBox on a UserForm that relates to a list which is updated

every
time the workbook is opened. At the moment, so that I can carry on with
other aspects, I have set the rowSource as follows:-

ComboBox1.RowSource = "A1:B456"

This of course is only temporary and I would appreciate a more permanent
solution.

Many thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How do I set the rowsource for a ComboBox for a dynamic list?

Thanks for trying, unfortunately I get a syntax error on the line

rng.Resize(,2)

"Tom Ogilvy" wrote:

Just guessing

With Worksheets("Sheet3")
set rng = .Range(.range("A1"),.Range("A1").end(xldown))
End with
rng.Resize(,2)
Combobox1.ColumnCount = 2
Combobox1.RowSource = rng.Address(external:=True)

--
Regards,
Tom Ogilvy

"ndm berry" wrote in message
...
I have a ComboBox on a UserForm that relates to a list which is updated

every
time the workbook is opened. At the moment, so that I can carry on with
other aspects, I have set the rowSource as follows:-

ComboBox1.RowSource = "A1:B456"

This of course is only temporary and I would appreciate a more permanent
solution.

Many thanks in advance.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I set the rowsource for a ComboBox for a dynamic list?

should be

set rng = rng.Resize(,2)

--
Regards,
Tom Ogilvy

"ndm berry" wrote in message
...
Thanks for trying, unfortunately I get a syntax error on the line

rng.Resize(,2)

"Tom Ogilvy" wrote:

Just guessing

With Worksheets("Sheet3")
set rng = .Range(.range("A1"),.Range("A1").end(xldown))
End with
rng.Resize(,2)
Combobox1.ColumnCount = 2
Combobox1.RowSource = rng.Address(external:=True)

--
Regards,
Tom Ogilvy

"ndm berry" wrote in message
...
I have a ComboBox on a UserForm that relates to a list which is

updated
every
time the workbook is opened. At the moment, so that I can carry on

with
other aspects, I have set the rowSource as follows:-

ComboBox1.RowSource = "A1:B456"

This of course is only temporary and I would appreciate a more

permanent
solution.

Many thanks in advance.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How do I set the rowsource for a ComboBox for a dynamic list?

Thank you very much it worked a treat!

"Tom Ogilvy" wrote:

should be

set rng = rng.Resize(,2)

--
Regards,
Tom Ogilvy

"ndm berry" wrote in message
...
Thanks for trying, unfortunately I get a syntax error on the line

rng.Resize(,2)

"Tom Ogilvy" wrote:

Just guessing

With Worksheets("Sheet3")
set rng = .Range(.range("A1"),.Range("A1").end(xldown))
End with
rng.Resize(,2)
Combobox1.ColumnCount = 2
Combobox1.RowSource = rng.Address(external:=True)

--
Regards,
Tom Ogilvy

"ndm berry" wrote in message
...
I have a ComboBox on a UserForm that relates to a list which is

updated
every
time the workbook is opened. At the moment, so that I can carry on

with
other aspects, I have set the rowSource as follows:-

ComboBox1.RowSource = "A1:B456"

This of course is only temporary and I would appreciate a more

permanent
solution.

Many thanks in advance.








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
RowSource for Sheet ComboBox Minitman Excel Worksheet Functions 3 March 24th 08 09:43 PM
combobox rowsource as code JasonSelf[_20_] Excel Programming 1 September 13th 05 08:44 PM
Combobox with a dynamic list Arishy[_2_] Excel Programming 12 August 12th 05 02:07 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM
combobox rowsource Newbie Excel Programming 1 September 8th 04 12:21 PM


All times are GMT +1. The time now is 11:42 AM.

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"