Variant ansprechen
31.01.2005 16:37:51
Dominic
ich brauch wieder mal Eure Hilfe. Wie ich weiß kann man mehrere Werte in einer Variablen speichern. Jetzt wollte ich es ausprobieren, leider klappt es soweit bei mir nicht. Wie kann ich dieses Ansprechen? Hier mein Code:
Sub check_for_existing()
Dim a As Integer
Dim b As Integer
Dim evaluation(1 To 15) As String
evaluation(1) = "Sales"
evaluation(2) = "EBITDA"
evaluation(3) = "EBITDAm"
evaluation(4) = "EBITA"
evaluation(5) = "EBITAm"
evaluation(6) = "EBIT"
evaluation(7) = "EBITm"
evaluation(8) = "EVSales"
evaluation(9) = "EVEBITDA"
evaluation(10) = "EVEBIT"
evaluation(11) = "NCF"
evaluation(12) = "DCF"
evaluation(13) = "EPS"
evaluation(14) = "ROCE"
evaluation(15) = "CAPEX"
With Worksheets(ComboBox1.Value)
For a = 1 To .Cells(1, 1).End(xlDown).Row
If .Cells(a, 1).Value = ComboBox2.Value Then Exit Sub
Next a
For b = 2 To 30 Step 2
.Cells(a + b - 1, 1).Value = ComboBox2.Value
.Cells(a + b - 1, 2).Value = evaluation(b / 2).Value 'Hier Fehler: evaluation(b / 2) wird nicht erkannt (Ungültiger Bezeichner)
.Cells(a + b - 1, 3).Value = "TC"
.Cells(a + b, 1).Value = ComboBox2.Value
.Cells(a + b, 2).Value = evaluation(b / 2).Value
.Cells(a + b, 3).Value = "GB"
Next b
End With
End Sub
vielen Dank im Voraus für die Hilfe!
Gruß
Dominic