Ich habe schon seit längerem ein Problem, wo ich absolut nicht weiter komme ohne eure Hilfe. Hoffentlich habt Ihr eine Lösung.
Auf einem Arbeitsblatt in Zelle A1 bis A9 habe ich Pfadangaben für diverse Mappen.
z.B.:
C:\TEST\testplan1.xls
C:\TEST\testplan2.xls
C:\TEST\testplan3.xls
C:\TEST\testplan4.xls
C:\TEST\testplan5.xls
C:\TEST\testplan6.xls
C:\TEST\testplan7.xls
C:\TEST\testplan8.xls
Ich möchte mit VBA alle diesen Mappen öffnen bis kein Eintrag mehr gefunden wird
Bis jetzt habe ich diesen Code gebastelt. Da ich aber eher VBA Amateur bin komme ich einfach nicht weiter als Mappe C:\TEST\testplan1.xls zu öffnen.
Sub TEST()
Dim Count As Long
Dim wks As Worksheet
Dim iRow As Integer
Dim sPath As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wks = ActiveSheet
iRow = 1
sPath = Cells(iRow, 1).Value
On Error GoTo ERRORHANDLER
Do Until IsEmpty(Cells(iRow, 1))
iRow = iRow + 1
Workbooks.Open sPath
Loop
ERRORHANDLER:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Ich Freue mich auf eure Hilfe.
Grüsse
Robert