How many variables are in Arrays ydelser . COUNT them. If you do not have at least 135 variable then the expression :
ydelser(dream)
is the culprit when Dream exceeds the number of variables in the array.
If you don't know the number you can easily check with the DIM function: numelements=dim(arrayname)
Or if Branche actually has fewer than 31 variables
... View more