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("[b]test lücken.xls[/b]").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 SubSub schließen()
Dim inTabellen As Integer
For inTabellen = Application.Workbooks.Count To 1 Step -1
If Workbooks(inTabellen).Name <> ThisWorkbook.Name Then Workbooks(inTabellen).Close
Next inTabellen
End Sub
Probleme beim seiten schließen!
prinzpoldi1911 14.03.2007 - 64 Hits -
Schließen Funktion deaktivieren
Jonk 25.06.2007 - 110 Hits - 6 Antworten
schleife beim installieren von winxp
reese 18.11.2007 - 72 Hits - 8 Antworten
Abfrage schließen
NochEinGast 30.04.2008 - 45 Hits - 6 Antworten