WorksheetFunction.Max(arrSpeicherD)
a = Application.WorksheetFunction.min(WorksheetFunction.Index(arrTest, 0, 2)) MsgBox a & " - " & arrTest(a, 2)
Dim arrTest(4, 2) As Variant Dim i As Long Dim a As Long a = LBound(arrTest) For i = LBound(arrTest) + 1 To UBound(arrTest) If arrTest(i, 2) < arrTest(a, 2) Then a = i Next i MsgBox "Das älteste Datum befindet sich an Position " & a & " im Array:" & vbLf & arrTest(a, 0) & ";" & arrTest(a, 1) & ";" & arrTest(a, 2)
Sub Test() Dim arrSpeicher() Dim lmgAnz As Long, i As Long, j As Long, lngZähler As Long For j = 1 To 3 ReDim Preserve arrSpeicher(0 To 2, 0 To lngAnz) arrSpeicher(0, lngAnz) = Cells(j, 5) arrSpeicher(1, lngAnz) = Cells(j, 4) arrSpeicher(2, lngAnz) = Cells(j, 6) ' hier steht das Datum lngAnz = lngAnz + 1 Next lngAnz = 0 a = Application.WorksheetFunction.Min(WorksheetFunction.Index(arrSpeicher, 0, 2)) MsgBox a & " - " & arrSpeicher(a, 2) End Sub
For j = 1 To 3 ReDim Preserve arrSpeicher( 0 To lngAnz) arrSpeicher( lngAnz) = Cells(j, 1) lngAnz = lngAnz + 1 Next
x = Application.Min(arrSpeicherD) y = Application.Match(x, arrSpeicherD)
Sub Test1() Dim arrSpeicher() Dim lngAnz As Long Dim i As Long Dim j As Long Dim lngZähler As Long Dim a As Variant lngAnz = ActiveSheet.Cells(Rows.Count, 4).End(xlUp).Row ReDim arrSpeicher(2, lngAnz - 1) For j = 0 To lngAnz - 1 arrSpeicher(0, j) = Cells(j + 1, 5) arrSpeicher(1, j) = Cells(j + 1, 4) arrSpeicher(2, j) = Cells(j + 1, 6) ' hier steht das Datum Next j a = 0 For j = 0 To UBound(arrSpeicher, 2) If arrSpeicher(2, j) < arrSpeicher(2, a) Then a = j Next j MsgBox a & " - " & arrSpeicher(0, a) & " - " & arrSpeicher(1, a) & " - " & arrSpeicher(2, a) End Sub
58.4k Fragen
249k Antworten
7k Nutzer