Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
RowSource is looking for a string (the range address as a string), not a
range object. check out the example in Help. -- Jim Rech Excel MVP "hgdev" wrote in message om... | Excel 2000 | | I am trying to get AutoFilter data into a ListBox. | The below code gives me an "Type mismatch" error when I try to add the | Listbox Rowsource line. I read about using _FilterDatabase but could | not get the right syntax. | | Private Sub UserForm_Initialize() | Dim myVisibleRng As Range | Dim myFilterRng As Range | Set myFilterRange = Sheet1.Range("a1:e13000") | myFilterRange.AutoFilter Field:=5, Criteria1:="18650" | Set myVisibleRange = myFilterRange.SpecialCells(xlCellTypeVisible) | Debug.Print myVisibleRange.Address | ListBox1.RowSource = myVisibleRange '<--type mismatch | End Sub | | | Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok. Thanks for response.
I see that now in Help; object.RowSource[=String] It has taken me hours to get this far. How do I turn/convert the Range Object output into a string to satisfy the .RowSource? "Jim Rech" wrote in message ... RowSource is looking for a string (the range address as a string), not a range object. check out the example in Help. -- Jim Rech Excel MVP "hgdev" wrote in message om... | Excel 2000 | | I am trying to get AutoFilter data into a ListBox. | The below code gives me an "Type mismatch" error when I try to add the | Listbox Rowsource line. I read about using _FilterDatabase but could | not get the right syntax. | | Private Sub UserForm_Initialize() | Dim myVisibleRng As Range | Dim myFilterRng As Range | Set myFilterRange = Sheet1.Range("a1:e13000") | myFilterRange.AutoFilter Field:=5, Criteria1:="18650" | Set myVisibleRange = myFilterRange.SpecialCells(xlCellTypeVisible) | Debug.Print myVisibleRange.Address | ListBox1.RowSource = myVisibleRange '<--type mismatch | End Sub | | | Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
set rng = Range("A1:A10")
Listbox1.Rowsource = rng.Address(external:=True) -- Regards, Tom Ogilvy "hgdev" wrote in message om... Ok. Thanks for response. I see that now in Help; object.RowSource[=String] It has taken me hours to get this far. How do I turn/convert the Range Object output into a string to satisfy the .RowSource? "Jim Rech" wrote in message ... RowSource is looking for a string (the range address as a string), not a range object. check out the example in Help. -- Jim Rech Excel MVP "hgdev" wrote in message om... | Excel 2000 | | I am trying to get AutoFilter data into a ListBox. | The below code gives me an "Type mismatch" error when I try to add the | Listbox Rowsource line. I read about using _FilterDatabase but could | not get the right syntax. | | Private Sub UserForm_Initialize() | Dim myVisibleRng As Range | Dim myFilterRng As Range | Set myFilterRange = Sheet1.Range("a1:e13000") | myFilterRange.AutoFilter Field:=5, Criteria1:="18650" | Set myVisibleRange = myFilterRange.SpecialCells(xlCellTypeVisible) | Debug.Print myVisibleRange.Address | ListBox1.RowSource = myVisibleRange '<--type mismatch | End Sub | | | Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
???Help??? Userform.Listbox.rowsource = ??? | Excel Discussion (Misc queries) | |||
RowSource in ListBox | Excel Programming | |||
ListBox Rowsource Limitation?? | Excel Programming | |||
Is refreshing listbox rowsource in listbox click event possible? | Excel Programming | |||
listbox rowsource | Excel Programming |