ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Populate Worksheet from ListBoxes (https://www.excelbanter.com/excel-programming/396686-populate-worksheet-listboxes.html)

Clayman

Populate Worksheet from ListBoxes
 
I would like to transfer the contents of several listboxes to a temporary
worksheet for the purpose of printing a report. I suppose I could loop
through the contents of the listbox, but isn't there a way to get all of it
at once?

My current thinking (which may be all wet) is to transfer the contents to an
array then from the array to the worksheet.

Thank you
--
Adios,
Clay Harryman

Chip Pearson

Populate Worksheet from ListBoxes
 
Clay,

Is the listbox from the Forms command bar or the Controls command bar, or is
it on a user form? Are you using the ListFillRange property?

You might try something like

Dim V As Variant
V = Sheet1.ListBox1.List
Range("C11").Resize(UBound(V) - LBound(V) + 1).Value = V


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Clayman" wrote in message
...
I would like to transfer the contents of several listboxes to a temporary
worksheet for the purpose of printing a report. I suppose I could loop
through the contents of the listbox, but isn't there a way to get all of
it
at once?

My current thinking (which may be all wet) is to transfer the contents to
an
array then from the array to the worksheet.

Thank you
--
Adios,
Clay Harryman



No Name

Populate Worksheet from ListBoxes
 
With ListBox1
Range("A1").Resize(.ListCount).Value = .List
End With


"Clayman" wrote in message
...
I would like to transfer the contents of several listboxes to a temporary
worksheet for the purpose of printing a report. I suppose I could loop
through the contents of the listbox, but isn't there a way to get all of
it
at once?

My current thinking (which may be all wet) is to transfer the contents to
an
array then from the array to the worksheet.

Thank you
--
Adios,
Clay Harryman





All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com