September 21, 2018
Hot Topics:

Basics of VB Programming

  • November 19, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »

The For..Next statement is an easy way to control program flow. e.g.

Dim i As Integer
Dim iValue As Integer
For i=0 To 10
Next i

In this situation iValue will equal 0 at the start and will increase by 1 every time until it reaches 10.

This can be used to process items from a list box. e.g.

Dim i As Integer
For i=0 To List1.ListCount
List2.AddItem List1.List(i)
Next i

This code copies all the list items from List1 to List2.

Page 4 of 6

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.


Thanks for your registration, follow us on our social networks to keep up-to-date