如果我要批量修改同一个文件夹下指定工作表中 多处 相同位置的内容我改怎么修改代码?

你给的代码是
Dim fso,excel
Folder="C:\Users\Administrator\Desktop\123"
address="A1"
Value="123"
set fso=createobject("scripting.filesystemobject")
set excel=createobject("excel.application")
excel.visible=true
for each file in fso.getfolder(folder).files
set w=excel.workbooks.open(file.path)
excel.Sheets("指定工作表").Range(address).Value=Value
W.SAVE
W.CLOSE
next
以上代码只能一次改一个工作表中的一处内容, 我想一次性改多处怎么修改代码
还有如果我要批量修改 同一个文件夹下所有文件中的 多个工作表中的 多处内容怎么一次性到位?

如图中有6个工作表,如果我要同时批量修改每个工作表中多个指定单元格的内容又应该怎么修改?

Dim objSFO
Dim objFolder
Dim objFiles
Dim objFile
address="A1"
Value="123"
set fso=createobject("scripting.filesystemobject")
set excel=createobject("excel.application")
Set objFolder = fso.GetFolder("C:\Users\Administrator\Desktop\123")
Set objFiles = objFolder.Files
For Each objFile In objFiles
If Right(objFile.Name, 4) = ".xls" Then
excel.visible=false
set w=excel.workbooks.open(objFile.path)
excel.Sheets("指定工作表").Range(address).Value=Value
W.SAVE
W.CLOSE
End If
Next
试试,有问题再说追问

请问这个代码是只能修改同一个工作表中 多个单元格的内容吗?
还是可以修改 多个工作表中 的 多个单元格的内容?

追答

是遍历123文件夹所有excel,然后修改统一个单元格,保存退出

来自:求助得到的回答
温馨提示:答案为网友推荐,仅供参考