Consulting

Results 1 to 3 of 3

Thread: Loop in VBA

  1. #1
    VBAX Newbie
    Joined
    Jul 2014
    Posts
    2
    Location

    Loop in VBA

    L.S.

    With a loop in VBA I try to display the following items:

    1. Number of tubes (colomn nconn)
    2. DN size of the tube (colomn DN size)

    De following items are already know:
    1. Number of tubes (colomn nconn)
    2. Mininal required crossection (aoc_min)

    So before running the loop I already know the start and end number of the loop (colomn index, range_start and range_end)

    Example:
    nconn=2 and nheader=1 then
    range_start=8 and range_end=11 and
    Aoc_min=0,018, then the result should be

    2x125

    However the result of the function is 2 x 65

    So is there anyone who can help me?

    Many thanks in advance.
    Attached Files Attached Files
    Last edited by teckna; 07-13-2014 at 06:14 AM.

  2. #2
    Knowledge Base Approver VBAX Guru
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    4,622
    add:
    Exit For
    after:
    Result = Aoc_calc

    In fact you can replace:
    Result = Aoc_calc
    with:
    Exit For
    since you never use Result.

    …and you don't need the line:
    Dim Int_dia_connVA As Double
    since you never use that variable.
    Last edited by p45cal; 07-13-2014 at 06:44 AM.
    p45cal - - - - -This is my signature, it appears after all my posts. Below is not directed at anyone in particular - so don't take offence! - (You might guess why it's there though)
    If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Newbie
    Joined
    Jul 2014
    Posts
    2
    Location
    Thanks Pascal, it's working now!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •