?
Solved

List index

Posted on 2003-03-24
5
Medium Priority
?
148 Views
Last Modified: 2010-05-01
Let's say I wanted to insert an item in a list at an index of 5. I put down the following code:

list1.additem("Item Name"(5))

Why doesn't this work...?
0
Comment
Question by:blizzdek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 7

Accepted Solution

by:
vbwizardry earned 80 total points
ID: 8200644
You forgot to add a “,” in between the value and the index as follows:
list1.additem("Item Name", 5)
AddItem( value, [index] )
Best regards
0
 

Expert Comment

by:momonja
ID: 8200705
whenever i do that it just says

COMPILE ERROR
EXPECTED: =
0
 

Expert Comment

by:momonja
ID: 8200728
whenever i do that it just says

COMPILE ERROR
EXPECTED: =
0
 

Expert Comment

by:momonja
ID: 8200729
what i think it should do, is use some sort of a for loop or something. I see that we've been experiencing weird problems.
0
 
LVL 1

Expert Comment

by:Piter
ID: 8201252

 I think it will not allow to enter 5th value. you have to enter first 4 values too.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question