Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / June 2007

Tip: Looking for answers? Try searching our database.

ListBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gordon - 11 Jun 2007 18:26 GMT
Can not get value from listBox to Variable.
My code: ListBox1 -> RowSource = A:A
UserForm_Activate() -> ListBox1.RowSource = "A1:A" & N  (# of names in
Col,A1)
This part works, but can't get user selection to Variable. Need help

Thanks,
GJ
Dave Peterson - 11 Jun 2007 20:43 GMT
Dim myVar as string
with me.listbox1
  if .listindex = -1 then
     'nothing chosen
     myvar = "Make a choice"  '????
  else
     myvar = .value
  end if
end with

may work.

> Can not get value from listBox to Variable.
> My code: ListBox1 -> RowSource = A:A
[quoted text clipped - 4 lines]
> Thanks,
> GJ

Signature

Dave Peterson

Jim Rech - 11 Jun 2007 20:49 GMT
For Counter = 0 to Listbox1.ListCount - 1
       If Listbox1.Selected(Counter) Then
          MsgBox Listbox1.List(Counter)
       End If
   Next

Signature

Jim

| Can not get value from listBox to Variable.
| My code: ListBox1 -> RowSource = A:A
[quoted text clipped - 4 lines]
| Thanks,
| GJ

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.