Hi Folks

I'm wondering if it's possible to loop trough variable names.

For example, I'd like to simplify/shorten the following with a for...next loop:

If IsMissing(strKriterium1) Then
' numEinzelResultate = 1
' ElseIf IsMissing(strKriterium2) Then
' numEinzelResultate = 2
' ElseIf IsMissing(strKriterium3) Then
' numEinzelResultate = 3
' ElseIf IsMissing(strKriterium4) Then
' numEinzelResultate = 4
' ElseIf IsMissing(strKriterium5) Then
' numEinzelResultate = 5
' ElseIf IsMissing(strKriterium6) Then
' numEinzelResultate = 6
' Else
' End If

My try would be something like:

For i = 1 to 6

If ismissing(strKriterium & i ) then (this is the problem; it tells me that strKriterium is not definded)
numEinzelResultate = i (this works obviously)
.....
next i

Any ideas?