WorksheetFunction.Match
23.11.2005 15:06:36
loca
das makro unten schreib in eine leere tabelle in die erste spalte hochlaufend zahlen. dann liest es diese zahlen in eine variable ein und gibt sie zu kontrolle wieder aus. danach gibt es aus, an welcher stelle in der variable die entsprechende zahl gespeichert ist.
kann mir jemand sagen, warum die WorksheetFunction.Match als speicherort innerhalb der variable immer eine zu hohe zahl ausgibt?
besten dank und gruss
Sub Makro1()
For i = 1 To 20
Cells(i, "A").Value = i
Next i
Dim country()
For i = 1 To 20
ReDim Preserve country(i)
country(i) = Cells(i, "A")
Next i
For i = 1 To 20
Cells(i, "B").Value = country(i)
Next i
For i = 1 To 20
Cells(i, "C").Value = WorksheetFunction.Match(i, country())
Next i
End Sub