Excelのヘッダーフッターを一括で書き換える
VBScriptで一気に置換。
'#1 フォルダ全部のファイルでやる場合 strDir = InputBox("ディレクトリ名を入力してください。") '#1 Set objFSO = WScript.CreateObject("Scripting.FileSystemObject") '#1 Set objFolder = objFSO.GetFolder(strDir) '#1 Set objExcel = CreateObject("Excel.Application") 'objExcel.Visible = True For Each objFile In objFolder.Files '#1 If Lcase(Right(objFile.Name, 4)) = ".xls" Then '#1 strArg = objFile.Path '#1 Set objWb = objExcel.Workbooks.Open(strArg) For Each ws In objWb.Worksheets With ws.PageSetup 'ヘッダ左をかきかえ .LeftHeader = "XX株式会社" 'フッタ中央書き換え .CenterFooter = "&P / &N" End With Next objWb.Close True 'リネーム objFile.Name = Replace(objFile.Name, "ワーク","test") End if '#1 Next objExcel.Quit Set objExcel = Nothing MsgBox "処理しました。"