simora
03-15-2014, 10:28 PM
I have some code that finds the address of a Value entered into a InputBox on an excel UserForm.
I want to display the results in a Multicolumn Listbox with headings after it finds something.
The Headings Can be Name & Address;
I can get the address, & I also need to get to Column A to display a Name to match that Address and display both in the Listbox.
Right now, its displaying them under each other in the ListBox. How can I restructure so that it puts the found items next to each other as it loops through .
My Code:
Do
Set rngPicked = Union(rngPicked, rngFind)
Set rngFind = .FindNext(rngFind)
UserForm2.ListBox1.AddItem rngFind.Address ' Cell Address
UserForm2.ListBox1.AddItem Cells(loc, 1) ' Column A Name
Cnt = Cnt + 1
SearchRecords = Cnt
Loop While Not rngFind Is Nothing And rngFind.Address <> strFirstAddress
I want to display the results in a Multicolumn Listbox with headings after it finds something.
The Headings Can be Name & Address;
I can get the address, & I also need to get to Column A to display a Name to match that Address and display both in the Listbox.
Right now, its displaying them under each other in the ListBox. How can I restructure so that it puts the found items next to each other as it loops through .
My Code:
Do
Set rngPicked = Union(rngPicked, rngFind)
Set rngFind = .FindNext(rngFind)
UserForm2.ListBox1.AddItem rngFind.Address ' Cell Address
UserForm2.ListBox1.AddItem Cells(loc, 1) ' Column A Name
Cnt = Cnt + 1
SearchRecords = Cnt
Loop While Not rngFind Is Nothing And rngFind.Address <> strFirstAddress