AW: RowCount bis zu bestimmten Wert
21.09.2020 13:31:29
Matthias
Hi Gerd,
ich bekomme die Fehlermeldung "Die Match-Eigenschaft des WorksheetFuction-Objektes kann nicht zugeordnet werden"
Mein Code sieht folgendermaßen aus:
Sub Test()
Dim koord1 As String
Dim koord2 As String
Dim koord1a As String
Dim koord2a As String
Dim koordB As String
k = 3 '2
kmax = Worksheets(2).UsedRange.SpecialCells(xlCellTypeLastCell).Row
Do Until k > kmax
koord1 = Cells(k - 1, 32).Value
koord2 = Cells(k, 32).Value
If Worksheets(2).Cells(k, 32).Value = "START" Then
Cells(k, 34).Value = "0"
Else
'welche Matrix
If Worksheets(2).Cells(k, 17).Value 32 Then
Worksheets("Matrix E2").Select
koord1a = WorksheetFunction.Match(koord1, Columns("A"), 0)
MsgBox "Zeile " & koord1a
koord2a = WorksheetFunction.Match(koord2, Rows(1), 0)
koordB = Cells(koord1a, koord2a).Value
Worksheets(2).Select
Cells(k, 34).Value = koordB
Else
Worksheets("Matrix E3").Select
koord1a = WorksheetFunction.Match(koord1, Columns("A"), 0)
MsgBox "Zeile " & koord1a
koord2a = WorksheetFunction.Match(koord2, Rows(1), 0)
koordB = Cells(koord1a, koord2a).Value
Worksheets(2).Select
Cells(k, 34).Value = koordB
End If 'welche Matrix
End If
k = k + 1
Loop
End Sub
Hast du eine Idee wo der Fehler liegt?
Danke und LG