[/url] http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=xl&Number=721287&page=0&view=collapsed&sb=5&o=0&fpart=&vc= [/url]
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
I have the following code to display a range of cells in a listbox. Does anyone know how I can display all the rows instead of a range. I cant enter A65536 because it shows me all the blank rows too.
Private Sub CommandButton2_Click()
Dim lbtarget As MSForms.ListBox
Dim rngSource As Range
'Set reference to the range of data to be filled
Set rngSource = Worksheets("Residents").Range("A2:H700")
'Fill the listbox
Set lbtarget = Me.ListBox1
With lbtarget
'Determine number of columns
.ColumnCount = 8
'Set column widths
.ColumnWidths = "50;80;100"
'Insert the range of data supplied
.List = rngSource.Cells.Value
End With
End Sub
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
I have the following code to display a range of cells in a listbox. Does anyone know how I can display all the rows instead of a range. I cant enter A65536 because it shows me all the blank rows too.
Private Sub CommandButton2_Click()
Dim lbtarget As MSForms.ListBox
Dim rngSource As Range
'Set reference to the range of data to be filled
Set rngSource = Worksheets("Residents").Range("A2:H700")
'Fill the listbox
Set lbtarget = Me.ListBox1
With lbtarget
'Determine number of columns
.ColumnCount = 8
'Set column widths
.ColumnWidths = "50;80;100"
'Insert the range of data supplied
.List = rngSource.Cells.Value
End With
End Sub