Ich schreibe ein VBA-Skript zu a. Kopieren Sie den Inhalt einer aktuellen Excel-Datei (mit Formatierung), b. Schleife durch alle anderen Excel-Dateien in seinem aktuellen Ordner, c. Fügen Sie das neue kopierte Arbeitsblatt in Excel-Dateien einVBA-Skript zum Durchlaufen von Dateien in seinem aktuellen Ordner und bearbeiten
Aus irgendeinem Grund funktioniert mein Code nicht. jeder kann bitte helfen ich bin neu in vba Scripting
Sub Macro7()
Dim wbf As Workbook
Dim myPath As String
Dim myFile As String
Dim currentFile As String
Dim mtExtension As String
myPath = Application.ActiveWorkbook.Path
currentFile = ActiveWorkbook.Name
MsgBox (myPath)
Dim objFSO As Object
Dim objFolder As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(myPath)
Count = 0
For Each objFile In objFolder.Files
If currentFile <> objFile.Name Then
Set wbt = Workbooks.Open(Filename:=myPath & "\" & objFile.Name)
MsgBox (objFile.Name)
.Sheets("Action Descriptions").Select After:=Workbooks(objFile.Name).Sheets(1)
ActiveWorkbook.Save
ActiveWindow.Close
End If
'
Next
' Loop
End Sub
Sie die Frage vergessen? – Max