[FONT="Courier New"]Sub btnRechnen_Click
IF label5.text="......" then
MsgBox("Standort auswählen")
Else if
for i=0 to Table1.RowCount-1
……………
…………[/FONT]
Is the value of label5.text=”......” the program works fine.
Is there an other value in label5.text (in my case a numeric value)
the program stops.
IF label5.text“……“ then
Error description:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
You should use Else instead of Else If (as you didn't use a condition):
IF label5.text="......" then
MsgBox("Standort auswählen")
Else
for i=0 to Table1.RowCount-1
……………
…………