PDA

View Full Version : [SOLVED:] Loop in VBA



teckna
07-13-2014, 05:59 AM
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.

p45cal
07-13-2014, 06:34 AM
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.

teckna
07-13-2014, 07:24 AM
Thanks Pascal, it's working now!