Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

List index

Posted on 2003-03-24
5
Medium Priority
?
149 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
  • 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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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
Course of the Month11 days, 10 hours left to enroll

564 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