HuHu, Leute
So machen wir's schnell und schmerzlos ...
Ich will in der Schleife alle geöffneten Tabellen
schließen außer die HauptTabelle (test lücken.xls)...
Kann mir jeamdn weiter helfen?
\\\\\\\\\\\\\ EDIT\\\\\\\\\\\\\\\\\\\
HAT SICH GEKLÄRT!
So machen wir's schnell und schmerzlos ...
Ich will in der Schleife alle geöffneten Tabellen
schließen außer die HauptTabelle (test lücken.xls)...
Kann mir jeamdn weiter helfen?
Quellcode
- Dim FileName(1 To 2000) As String
- Dim MaxTab As Integer
- Sub Main()
- Call Msg
- Call Scopy
- End Sub
- Sub Scopy()
- ChDir "D:\*****\******\"
- '
- For I = 1 To MaxTab
- Workbooks.Open FileName:=FileName(I)
- Application.CutCopyMode = False
- Range("A5:A5").Select
- Selection.Value = ActiveWorkbook.Name
- Range("A5").Select
- Text1 = ActiveCell.Value
- Range("B5:L12").Select
- Selection.Copy
- Windows("test lücken.xls").Activate
- Zeile = (5 + (I - 1) * 8)
- Range(Cells(Zeile, 2), Cells(Zeile, 12)).Select
- ActiveSheet.Paste
- Range(Cells(Zeile, 1), Cells(Zeile, 1)).Select
- ActiveCell.Value = Text1
- Next I
- End Sub
- Sub Msg()
- Set fs = Application.FileSearch
- With fs
- .LookIn = "D:\****\*****\"
- .FileName = "*.xls"
- MaxTab = fs.FoundFiles.Count
- If .Execute(SortBy:=msoSortByFileName) > 0 Then
- For I = 1 To .FoundFiles.Count
- ' MsgBox .FoundFiles(I)
- FileName(I) = fs.FoundFiles(I)
- Next I
- Else
- MsgBox "There were no files found."
- End If
- End With
- End Sub
\\\\\\\\\\\\\ EDIT\\\\\\\\\\\\\\\\\\\
HAT SICH GEKLÄRT!
Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von „Kennyger“ ()