Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default listbox not dsplaying all records in a named range

I have a listbox that gets it's items from an advanced query moved to a named
range (using offset to define the range). The query works and when I examine the
named range, all the rows are selected as they should be. Yet, when the listbox
is populated from the named range, not all the rows are listed. It seems to
happen when the first selection shows fewer items than the next. It then
'remembers' this smaller range and will not display the rest in the filter
output. Any ideas on how to have the listbox control the accurate number of rows
in the range consistently? Thank you so much for any replies.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default listbox not dsplaying all records in a named range

ActiveX Listboxes that use dynamically calculated named ranges don't update
with each calculate. You will have to use some code to re-assign the
rowsource to stimulate the update. Perhaps put this in the calculate event.

--
Regards,
Tom Ogilvy

"Andy" wrote in message
news:jpvkc.325674$Ig.35171@pd7tw2no...
I have a listbox that gets it's items from an advanced query moved to a

named
range (using offset to define the range). The query works and when I

examine the
named range, all the rows are selected as they should be. Yet, when the

listbox
is populated from the named range, not all the rows are listed. It seems

to
happen when the first selection shows fewer items than the next. It then
'remembers' this smaller range and will not display the rest in the filter
output. Any ideas on how to have the listbox control the accurate number

of rows
in the range consistently? Thank you so much for any replies.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default listbox not dsplaying all records in a named range

Thanks for the reply Tom. I believe I can use something like ListBox4.RowSource
= "Category_Table" to help stimulate the update, but I'm not sure which change
event to try it in. I believe I've tried the events at the worksheet and form
level, but I've had no luck in implementing your solution. I feel dense so any
additional details you may supply are most welcome O.o
"Tom Ogilvy" wrote in message
...
ActiveX Listboxes that use dynamically calculated named ranges don't update
with each calculate. You will have to use some code to re-assign the
rowsource to stimulate the update. Perhaps put this in the calculate event.

--
Regards,
Tom Ogilvy

"Andy" wrote in message
news:jpvkc.325674$Ig.35171@pd7tw2no...
I have a listbox that gets it's items from an advanced query moved to a

named
range (using offset to define the range). The query works and when I

examine the
named range, all the rows are selected as they should be. Yet, when the

listbox
is populated from the named range, not all the rows are listed. It seems

to
happen when the first selection shows fewer items than the next. It then
'remembers' this smaller range and will not display the rest in the filter
output. Any ideas on how to have the listbox control the accurate number

of rows
in the range consistently? Thank you so much for any replies.






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default listbox not dsplaying all records in a named range

I used code like this with a modeless userform and it worked for me:

Private Sub Worksheet_Calculate()
Dim uform As msforms.UserForm
If UserForms.Count 0 Then
On Error Resume Next
Set uform = UserForm1
On Error GoTo 0
If Not uform Is Nothing Then
' MsgBox "update"
uform.ListBox1.RowSource = "Category_Table"
End If
Else
' MsgBox "Not found"
End If
End Sub

--
Regards,
Tom Ogilvy




"Andy" wrote in message
news:b4zkc.326937$Ig.121106@pd7tw2no...
Thanks for the reply Tom. I believe I can use something like

ListBox4.RowSource
= "Category_Table" to help stimulate the update, but I'm not sure which

change
event to try it in. I believe I've tried the events at the worksheet and

form
level, but I've had no luck in implementing your solution. I feel dense

so any
additional details you may supply are most welcome O.o
"Tom Ogilvy" wrote in message
...
ActiveX Listboxes that use dynamically calculated named ranges don't

update
with each calculate. You will have to use some code to re-assign the
rowsource to stimulate the update. Perhaps put this in the calculate

event.

--
Regards,
Tom Ogilvy

"Andy" wrote in message
news:jpvkc.325674$Ig.35171@pd7tw2no...
I have a listbox that gets it's items from an advanced query moved to

a
named
range (using offset to define the range). The query works and when I

examine the
named range, all the rows are selected as they should be. Yet, when

the
listbox
is populated from the named range, not all the rows are listed. It

seems
to
happen when the first selection shows fewer items than the next. It

then
'remembers' this smaller range and will not display the rest in the

filter
output. Any ideas on how to have the listbox control the accurate

number
of rows
in the range consistently? Thank you so much for any replies.








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default listbox not dsplaying all records in a named range

Works like a charm for all of the listboxes. Thank you for helping me with this,
and helping others.

"Tom Ogilvy" wrote in message
...
I used code like this with a modeless userform and it worked for me:

Private Sub Worksheet_Calculate()
Dim uform As msforms.UserForm
If UserForms.Count 0 Then
On Error Resume Next
Set uform = UserForm1
On Error GoTo 0
If Not uform Is Nothing Then
' MsgBox "update"
uform.ListBox1.RowSource = "Category_Table"
End If
Else
' MsgBox "Not found"
End If
End Sub

--
Regards,
Tom Ogilvy




"Andy" wrote in message
news:b4zkc.326937$Ig.121106@pd7tw2no...
Thanks for the reply Tom. I believe I can use something like

ListBox4.RowSource
= "Category_Table" to help stimulate the update, but I'm not sure which

change
event to try it in. I believe I've tried the events at the worksheet and

form
level, but I've had no luck in implementing your solution. I feel dense

so any
additional details you may supply are most welcome O.o
"Tom Ogilvy" wrote in message
...
ActiveX Listboxes that use dynamically calculated named ranges don't

update
with each calculate. You will have to use some code to re-assign the
rowsource to stimulate the update. Perhaps put this in the calculate

event.

--
Regards,
Tom Ogilvy

"Andy" wrote in message
news:jpvkc.325674$Ig.35171@pd7tw2no...
I have a listbox that gets it's items from an advanced query moved to

a
named
range (using offset to define the range). The query works and when I
examine the
named range, all the rows are selected as they should be. Yet, when

the
listbox
is populated from the named range, not all the rows are listed. It

seems
to
happen when the first selection shows fewer items than the next. It

then
'remembers' this smaller range and will not display the rest in the

filter
output. Any ideas on how to have the listbox control the accurate

number
of rows
in the range consistently? Thank you so much for any replies.












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
Referencing a named range based upon Range name entry in cell Barb Reinhardt Excel Worksheet Functions 14 June 20th 07 07:19 PM
automatic range - named range give me circular reference... George Thorogood Excel Discussion (Misc queries) 0 February 22nd 07 07:53 PM
Array as a "named range" - formula ok in cells, but error as "named range" tskogstrom Excel Discussion (Misc queries) 11 December 28th 06 04:44 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


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

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

About Us

"It's about Microsoft Excel"