View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default using a variable length list to poplate a List Box

'You can use a variable to identify the last row of the range. Assume that
your RowSource or ListFillRange is in Column A:

lasrRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row

'Then Set an object variable to represent the dynamic range:

Set myRowSrc = ActiveSheet.Range("A2: A" 7 lastRow)

'To use this effectively, you would need to place the Set statement in the
code so that if your range is changed using a loop, the Set statement will
re-initialize on each iteration of the loop. Otherwise, it would be the
same as assigning a static range for RowSource.


"RocketRod" wrote in message
...
I have a spreadsheet with a list of values which can be modified by others
with extra entries.
I need to populate t a List Box with all the entries taking into account
how
many there are now in the list.
Is there a way to automatically set/update the number of entries in the
list
as it jumps down to the next row as long as the next row is not blank?