Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Dynamic range not resized for RowSource usage

I've defined a range name "rng":

=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A$2:$A$6553 6),1)

and then used that as the rowsource for a listbox in a userform.

Problem is, when I add a new value to the list, the range is not resized
until I close/reopen the form.

Anybody know a workaround?

Thanks.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Dynamic range not resized for RowSource usage

Hi Tim:

I'm assuming you are using a modeless UserForm. This worked for me:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then UserForm1.ListBox1.RowSource = "rng"
End Sub

--

Vasant

"Tim Zych" wrote in message
...
I've defined a range name "rng":

=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A$2:$A$6553 6),1)

and then used that as the rowsource for a listbox in a userform.

Problem is, when I add a new value to the list, the range is not resized
until I close/reopen the form.

Anybody know a workaround?

Thanks.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Dynamic range not resized for RowSource usage

rowsource doesn't work very well with defined names - at least not very
dynamically. Reassign the rowsource should make it use the latest value.

--
Regards,
Tom Ogilvy

"Tim Zych" wrote in message
...
I've defined a range name "rng":

=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A$2:$A$6553 6),1)

and then used that as the rowsource for a listbox in a userform.

Problem is, when I add a new value to the list, the range is not resized
until I close/reopen the form.

Anybody know a workaround?

Thanks.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Dynamic range not resized for RowSource usage

Vasant, Tom:
I thought I tried that and it didn't work. Guess not. Programmatically
resetting it seems to fix it.
Thanks

"Tom Ogilvy" wrote in message
...
rowsource doesn't work very well with defined names - at least not very
dynamically. Reassign the rowsource should make it use the latest value.

--
Regards,
Tom Ogilvy

"Tim Zych" wrote in message
...
I've defined a range name "rng":

=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A$2:$A$6553 6),1)

and then used that as the rowsource for a listbox in a userform.

Problem is, when I add a new value to the list, the range is not resized
until I close/reopen the form.

Anybody know a workaround?

Thanks.







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
range usage question jzingman Excel Worksheet Functions 6 January 10th 08 04:45 PM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Variable usage in Range Command DavidC[_2_] Excel Programming 2 May 27th 04 03:51 AM
Listbox Rowsource Headings Multi columns Copy Range If Then Conditional hgdev Excel Programming 0 February 27th 04 05:27 PM
ComboBox RowSource --- can I use a userform OWC10 spreadsheet range? Dean Frazier Excel Programming 0 February 11th 04 07:16 PM


All times are GMT +1. The time now is 04:36 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"