|
-
Sep 15th, 2000, 02:17 PM
#1
Thread Starter
Junior Member
Desperately seeking answer.....
Anyone know how to get the contents of a list box to be copied to a worksheet range? I have created a New Collection object which takes a range and finds and sorts the unique entries in the range. I've gotten this "colletion" to show up in a test userform/listbox, but what I really need is for the unique/sorted list to be copied to another worksheet range. Any ideas would be most appreciated. Thanks!
-
Sep 15th, 2000, 02:34 PM
#2
This will add the contents of a ListBox to a Collection.
Code:
Dim LstCol As Collection
Private Sub Command1_Click()
Set LstCol = New Collection
For I = 0 To List1.ListCount - 1
LstCol.Add List1.List(I)
Next I
End Sub
-
Sep 15th, 2000, 02:40 PM
#3
Thread Starter
Junior Member
Listboxes
OK...I already have the contents of the listbox as a collection. What I need to do is be able to put the contents of that collection/listbox into a spreadsheet (I'm using VBA).
If the items in the collection are, for example,
Maryland
Virginia
Texas
Florida
I need to be able to put those into a spreadsheet range:
A1 = Maryland
A2 = Virginia
A3 = Texas
A4 = Florida
The number of items in the collection will change so I need to be able to erase the worksheet range before running the macro again and re-populating it with a new list of items.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|