Frage zu Arrays
26.02.2008 16:08:00
Fred
ich habe mal eine Frage zu Arrays, die ich mir trotz Suche im Archiv irgendwie nicht beantworten konnte - vll.t suche ich aber auch falsch.
Folgender Code:
Sub testarrays()
' Setzt alle Werte wieder zurück
Application.ScreenUpdating = False
Dim firstcell As Range
Dim novalues As Variant
' Bestimme 1. Zelle
Cells(14, 6).Select
Set firstcell = ActiveCell
novalues = Array(3, 5, 11, 12, 13, 18, 19, 21, 22, 23, 24, 26, 27)
For i = 1 To 30
If i novalues Then ' HIER GIBT ES EINEN FEHLER
For a = 1 To 5
firstcell.Offset(i - 1, 2 + a).FormulaR1C1 = "=+Prämissen_GuV!RC[-1]"
Next a
End If
Next i
End Sub
Ich möchte, dass die 2. Schleife nur durchlaufen wird, falls i ungleich einer der Werte von novalues ist. Hier bekomme ich aber eine Fehlermeldung. Was mache ich falsch?
Gruß
Fred