对一个文件夹下的多个EXCEL文件进行同一列内容的批量替换。
展开全部
可以使用vba操作。<br>1. 关闭其他所有excel,打开一个excel;<br>2. 复制如下代码到模块中;<br>3. 运行,选择文件夹。<br>4. 该代码删除的是a列,可选择其他列。更该代码即可。<br><br>sub del_col()<br>application.displayalerts = false<br>dim myfile as string<br>dim mydoc as string<br>with application.filedialog(msofiledialogfolderpicker)<br>.show<br>.allowmultiselect = false<br>.title = "选择文件夹"<br>myfile = .selecteditems(1)<br>end with<br>mydoc = dir(myfile & "\" & "*.xls*")<br>do while len(mydoc) <> 0<br>workbooks.open (myfile & "\" & mydoc)<br>worksheets(1).columns("a:a").select '删除a列<br>selection.delete shift:=xltoleft<br>workbooks(2).close<br>save = true<br>mydoc = dir<br>loop<br>application.displayalerts = true<br>end sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询