0
我在寫一個vba腳本到 a。複製一個當前excel文件的內容(帶格式), b。循環瀏覽當前文件夾中的所有其他excel文件, c。將新複製的工作表添加到excel文件中VBA腳本循環瀏覽當前文件夾中的文件並編輯
由於某種原因,我的代碼無法正常工作。任何人都可以請幫我 在VBA腳本
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
你忘了問題嗎? – Max