Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default populating multicolumn listbox with an array instead of...

I know I am doing this wrong but it gets me close to what I want
because of the way I am dealing with records.

I am inserting my previous post below. Any help please? How should
this be different?


---


This presents everything the way I want, filtering for the State I
want in the form, and I can dump it to a textbox to edit but NOW I see
that storing the edited version will pose problems.

Basically I see that I went about this all wrong because I am lost
when it comes to knowing how to do this with arrays.

This code populates a listbox by first getting the variable it needs
from a clickable map.

Thanks to anyone who can help me understand.

Scott
------

Private Sub UserForm_Initialize()

Dim Contact As String
Dim phone As String
Dim str As String

'pull the State variable from another sub
'to build the listbox contents

UserForm1.Caption = State
ListBox1.ColumnCount = 4
'I want this to be a multicolumn listbox eventually

On Error Resume Next

EntryCount = 1 'to set the starting value

For Each Cell In Sheets("Security").Range("e2:e2000")

'the State is stored in column E

EntryCount = EntryCount + 1 'since the index starts at zero
'and we use the 1st row as a header

Contact = Cell.Offset(0, -4)
phone = Cell.Offset(0, 2)

str = EntryCount & vbTab & State & vbTab & Contact & vbTab & phone
If Cell = State Then ListBox1.AddItem (str) Else


Next Cell
EntryCount = 0
ListBox1.TextColumn = -1


CommandButton1.Caption = "Edit Selection"
CommandButton2.Caption = "Remove Selection"
End Sub

Reply
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
Populating listbox with sheet names johnb Excel Discussion (Misc queries) 1 May 16th 08 12:33 PM
Populating listbox Mick[_2_] Excel Discussion (Misc queries) 1 May 14th 08 10:48 PM
Populating multicolumn listbox the wrong way notsureofthatinfo Excel Programming 0 October 22nd 03 11:38 PM
multicolumn Listbox and textalignment John Holland Excel Programming 3 September 11th 03 01:45 AM
Values in a MultiColumn Listbox Tom Ogilvy Excel Programming 5 September 5th 03 08:30 PM


All times are GMT +1. The time now is 09:59 AM.

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

About Us

"It's about Microsoft Excel"