AW: Nachfrage
02.08.2009 11:04:15
BoskoBiati
Hallo Peter,
hier mal ein Versuch:
Dim wkb As Workbook
Dim wks1 As Worksheet
Dim wks As Worksheet
Dim Zelle As Range
Dim rngIstda As Range
Dim rngSuchBer As Range
Dim loLetzte1 As Long
Dim loLetzte2 As Long
Dim lngCo1 As Long
Dim strPfad As String
Dim strTabName As String
Dim strBlattname As String
Set wks1 = ThisWorkbook.Sheets("Gesamt")
For lngCo1 = 1 To 2
strTabName = Format(MonthName(lngCo1, True), "###") & " 09"
strBlattname = Format(MonthName(lngCo1, True), "###")
strPfad = "C:\Dokumente und Einstellungen\Apotheke\" & strTabName & ".xls"
Set wkb = Workbooks.Open(strPfad)
Set wks = wkb.Sheets(strBlattname)
loLetzte1 = wks1.Cells(Rows.Count, 1).End(xlUp).Row
loLetzte2 = wks.Cells(wks.Rows.Count, 1).End(xlUp).Row - 1
Set rngSuchBer = wks1.Range("A2:A" & loLetzte1)
If loLetzte1
Vorraussetzung für das ordnungsgemäße Funktionieren ist:
1. Du musst den Pfad in strPfad anpassen
2. Die Dateien sollten unter Jan 09.xls bis Dez 09.xls gespeichert sein
3. Die Tabellen sollten Jan bis Dez heißen.
Sollte das nicht so sein, dann sind die Schleifen falsch.
Eine Sortierroutine habe ich jetzt nicht eingebaut, das wäre ggf. noch machbar.
Gruß
Bosko