Library tutorials & articles

For...Next statement

Introduction

The For...Next statement allows you to run one or more lines of code a fixed amount of times. For example, you can use it when you want to run a piece of code repeatedly 100 times.

Comments

  1. 04 Mar 2009 at 19:25
    Hi, this is my first so apologise if I'm interupting a thread. When using a for next loop, using 'i' i want to be able to select a combobox or text box using the 'i' value. Each combobox is called ComboBox1, Combobox2 etc. I want to be able to go through each one of them and select them each in turn so I can read what is in them. I've tried 'ComboBox&i. Select' and various other ways but can't get it to work. Help!!! Neil
  2. 01 Nov 2003 at 09:09

    Quote:
    I  need an equation such as a * b = c and a / c = b and b / c = a where the user types in 2 of the variables in text boxes and some proccess (such as a button click) would calculate the result.  


    first, I know what you mean by circular reference but in the way excel means it is that a circular reference is a feedback loop... and any programming that allows this usualy crashes


    So... lets see what you want to perform.


    we are creating the value of "C" from both "A" and "B"
    we are creating the value of "B" from both "A" and "C"
    we are creating the value of "A" from both "B" and "C"


    It cant work


    you cant create a value from nothing - to make anything you must add something to it to create it


    ie. think of it this way - your mum and dad created you, thats an equation
    if Mum = A and Dad = B and You are C then
    A + B = C


    Ok, so... now this is just an equation and dont get all religious on me but lets say you wanted to do the following equation


    Mum + Son = Dad
    or Son + Dad = Mum


    Since Son is a product of Mum and Dad you cant use that product to create its source


    Why would you need this equation, im curious?


  3. 30 Oct 2001 at 08:39

    I need to create an If...Then loop because I  need an equation such as a * b = c and a / c = b and b / c = a where the user types in 2 of the variables in text boxes and some proccess (such as a button click) would calculate the result.  At the moment I keep getting the syntax wrong (am quite new to programing) so it never works

  4. 29 Oct 2001 at 16:15

    What exactly do you mean by a circular reference...? (I know what you mean in reference to Excel, but I'm not sure how'd that translate to another language...)

  5. 24 Oct 2001 at 15:18

    Is it possible to create a circular reference (in any programming language), because I know that Excel won't do it?

  6. 01 Jan 1999 at 00:00

    This thread is for discussions of For...Next statement.

Leave a comment

Sign in or Join us (it's free).

James Crowley James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audience ...
AddThis

Related discussion

Related podcasts

  • Christian Beauclair

    14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...

We'd love to hear what you think! Submit ideas or give us feedback