LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Storing the results of a list box

Actually, I was being dumb, you don't need a v ariable, yopu could access
the control directly.

Similalrly, if it multi-select, you could in Userform2 use

Dim i As Long

With UserForm1.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
MsgBox .Value
End If
Next i
End With


--
HTH

Bob Phillips

"Simon Shaw" <simonATsimonstoolsDOTcom wrote in message
...
This doesn't work as he Listbox is a multiselect.

I also want to be able to re-populate the listbox with the previous
selection if the user opens the second userform again.

Thanks

"Bob Phillips" wrote:

On the first userform, declare a public string

Public myVal As String

In the second, set it say on the Listbox click

Userform1.myVal = Me.Listbox1.Value

--
HTH

Bob Phillips

"Simon Shaw" <simonATsimonstoolsDOTcom wrote in message
...
What is the best method of storing the selected results of a listbox?

to a
variable?

I am calling a userform from another userform and I need to pass back

the
selections of a listbox to the first userform, not for display but

rather
for
later processing.

I have tried declaring a public variable as type ListBox, then tried

Set PublicListBox = ListBox

i get a type mismatch error, an ideas?

Thanks

Simon Shaw






 
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
Is there an excel template for storing laboratory results Ian Excel Discussion (Misc queries) 1 January 8th 09 10:59 PM
Storing Macro Results daphoenix Excel Worksheet Functions 1 June 26th 08 05:48 PM
Filter the results of a list based on a previous vlookup against the same list Mizpah Excel Worksheet Functions 2 August 18th 06 10:28 AM
How to Update filter criteria from list and storing the query to another worksheet changeable[_3_] Excel Programming 1 November 1st 04 02:11 PM
How can I list the results of my macro without overwritng previous results? mattip Excel Programming 3 November 28th 03 03:45 AM


All times are GMT +1. The time now is 04:29 PM.

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"