Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 9th, 2009, 03:13 PM
Registered User
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default ListBox selected item retrieval help


This is my first time posting on this site and I am a beginner VB programmer. I have been able to solve many of my previous questions through existing threads but have not found what I need to solve this problem. My problem is that I have a listbox on my main sheet that I can successfully import data to but am having trouble retrieving the selected items and using them in further calculations. Where I am having the biggest problem now is in the following piece of code:

 Visual Basic 4 / 5 / 6 Syntax
Dim lItem As Long
Dim Count As Integer
Set Count = Set_Listbox.ListCount              (Problem here!!!)
For lItem = 0 To Count - 1
      If ListBox1.Selected(lItem) = True Then
            Sheets("Main").Range("A65536").End(xlUp)(25, 7) =              ActiveSheet.Shapes("Set_Listbox").List(lItem)
            ActiveSheet.Shapes("Set_Listbox").Selected(lItem) = False
      End If
Next lItem
I am getting the error that an object is required and after over 4 hours of trying to look for existing threads on the subject, I have not found much help. Any help will be greatly appreciated. If this is the wrong forum, I apologize.

Thanks a lot,

Reply With Quote
  #2 (permalink)  
Old October 19th, 2009, 07:17 AM
Registered User
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

I posted this same problem on another forum and received 9 responses whereas on this forum I received none. My problem is solved. Thanks anyway.
Reply With Quote
  #3 (permalink)  
Old October 21st, 2009, 09:16 PM
Registered User
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

OK What other forum.
That is good info too!
Reply With Quote
  #4 (permalink)  
Old October 22nd, 2009, 07:37 AM
Registered User
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

DaniWeb is the other forum.
Reply With Quote
  #5 (permalink)  
Old October 23rd, 2009, 01:01 AM
Authorized User
Join Date: Mar 2009
Posts: 49
Thanks: 0
Thanked 8 Times in 8 Posts

For a nice listing of forums see... http://www.daniweb.com/forums/thread214396.html

Good Luck

PS. vbforums has the highest traffic
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
unselect all other items in listbox when certain item selected Hughesie78 Pro VB.NET 2002/2003 1 February 23rd, 2009 07:40 AM
Chapter 5 GridView Selected Item stoverje BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2 2 August 8th, 2008 03:11 PM
How to get selected item from listview? try.test.abc C# 1 January 4th, 2007 02:34 AM
Datagrid - Scroll to selected item rodmcleay ASP.NET 1.0 and 1.1 Professional 2 February 21st, 2005 08:36 PM
How to get selected Item from Listbox? Iceman571 ADO.NET 1 March 25th, 2004 06:33 AM

All times are GMT -4. The time now is 08:21 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.