LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Displaying a 1d Array in a spreadsheet and a list-box

Option Explicit
Sub AA()
Dim LstSubFldrs As Variant
Dim lngth As Long
LstSubFldrs = Array("Cat", "Barclay Mowlem", "Allflex", _
"AWU", "Burdekin Shire Council", _
"Business Success Group", "Cash Sales", _
"Colorado", "Flight Centre", "Foot Locker")

UserForm1.ListBox1.List = LstSubFldrs
UserForm1.Show

lngth = UBound(LstSubFldrs) - LBound(LstSubFldrs) + 1
Range("A1").Resize(lngth, 1).Value = Application.Transpose(LstSubFldrs)
End Sub



--
Regards,
Tom Ogilvy


"Andy" wrote in message
...
Hello

I have an array ListSubFldrs that is a result of a macro that searches for
sub-directory names within a folder. It can vary in size depending on how
many sub-directories there are.

eg. copied from Local Window...

ListSubFldrs : ",Cat,Barclay Mowlem,Allflex,AWU,Burdekin Shire
Council,Business Success Group,Cash Sales,Colorado,Flight Centre,Foot

Locker"
: Variant/String

Any suggestions for code that would result in a vertical list in the .xls
starting at A1.

eg.

Cat
Barclay Mowlem
Allflex
AWU
Burdekin Shire Council
Business Success Group
Cash Sales
Colorado
Flight Centre
Foot Locker

How do I then get this list into a list box within a form? Do I refer to

the
.xls or the Array 'ListSubFldrs'?

Thanks,

Andrew Heath





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Taking the Zeros out of an array when displaying Bullytt Excel Discussion (Misc queries) 7 January 7th 10 09:32 PM
Spreadsheet not displaying Stephgill Excel Discussion (Misc queries) 4 October 9th 08 07:50 PM
Pie chart not displaying % in spreadsheet MaryAnne@Maloney Charts and Charting in Excel 1 March 24th 06 08:07 PM
Displaying URL images in a spreadsheet kennyharrill Excel Discussion (Misc queries) 1 March 13th 06 09:38 PM
Need help displaying array contents jsatz Excel Programming 3 October 3rd 03 09:33 PM


All times are GMT +1. The time now is 11:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"