Hilfe warum funktioniert die do anweisung nicht
25.02.2005 10:25:12
Armin
weder die do anweisung wird ausgeführt noch die Variable i wird hochgezählt
ich habe mal die ganze funktion hier rein gestellt
Function abestand(artikel, aufmachung)
Dim letzteZeile As Integer
Dim aktueller_bestand As Integer
Dim i As Integer
Dim links As String
Dim rechts As String
Application.Volatile
Sheets("Bestand").Select ' Blatt ermitteln
links = Left(artikel, 6) 'linker teil des zu suchenden Artikel
rechts = Right(aritkel, 3) ' rechter teil
i = 2 ' Laufvariable
Do While IsEmpty(Sheets("Bestand").Cells(i, 1)) = False ' mache es so lange bis zelle leer
' Bedingung feststellen
If links = Left(Worksheets(1).cell(i, 1), 6) And _
rechts = Right(Worksheets(1).cell(i, 1), 3) And _
aufmachung = Worksheets(1).cell(i, 2) Then
aktueller_bestand = Worksheets(2).cell(i, 6) ' Wert zuweisen
End If
i = i + 1
Loop
abestand = aktueller_bes