Dateinamen einlesen - vorher letzte Zeile fnden
03.07.2003 17:51:41
Claus
Ich brauche nochmal eure Hilfe. Der Code soll im ersten Loop-Teil alle gefüllten Zeilen ab der fünften Zeile zählen.
Im zweiten Loop-Teil sollen dann die Dateinamen aus einem Verzeichnis unterhalb der letzten Zeile mit Inhalt eingefügt werden...
Da habe ich allerdings irgendwas falsch gemacht und weiß nicht weiter...
Weiß einer von euch Rat?
Hier der Code:
Private Sub CommandButton1_Click()
Dim sFile As String, sPattern As String, sPath As String
Dim iRow As Integer
Dim nRow As Integer
iRow = 5
Do Until Application.WorksheetFunction.CountBlank(Rows(x)) = 256
iRow = iRow + 1
Loop
sPath = InputBox( _
prompt:="Pfad:", Default:="C:\acm\hs011")
If Right(sPath, 1) <> "\" Then sPath = sPath & "\"
sPattern = InputBox( _
prompt:="dateifilter:", Default:="*.cmd")
sFile = Dir(sPath & sPattern)
Do Until sFile = ""
nRow = iRow + 1
Cells(nRow, 1).Value = sFile
sFile = Dir()
Loop
End Sub