View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Variable List Box Range

#1. I put a listbox from the control toolbox toolbar on a worksheet. I
assigned its listfillrange to A1:a4. I assigned its linkedcell to B1

When I used the arrow key to scroll through the listbox, the linkedcell changed.

#2. You could assign the listbox's listfillrange when the workbook opens.

Option Explicit
Private Sub Workbook_Open()
With Sheet1
.ListBox1.ListFillRange = ""
.ListBox1.List = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp)).Value
End With
End Sub

peter_rivera wrote:

Hi all, thanks for the help on my previous questions.
I have two new ones:

1. First, I would like it if whenever someone scrolls down on a listbox
using the arrow keys that the linked textboxes would automatically
update their info.

2. Second, is there a way to code the rowsource of a listbox so that
its range is always equal to the rows of its source spreadsheet? The
spreadsheet is generated aoutomatically and the number of records
varies from customer to customer.

Thanks!
Peter

--
peter_rivera
------------------------------------------------------------------------
peter_rivera's Profile: http://www.excelforum.com/member.php...o&userid=24495
View this thread: http://www.excelforum.com/showthread...hreadid=381591


--

Dave Peterson