作者:sisihg_676 | 来源:互联网 | 2023-05-18 13:28
Wouldthebelowcodebeabletobemodifiedto1loopthroughallsheetsinaworkbookand2remove
Would the below code be able to be modified to 1 loop through all sheets in a workbook and 2 remove multiple columns based on their headers?
下面的代码是否能够修改为1循环遍历工作簿中的所有工作表,2根据其标题删除多个列?
example: "status","Status Name","Status Processes" etc.)? And then cycle through all sheets in the wkbk to do the same checks?
例如:“状态”,“状态名称”,“状态进程”等)?然后循环遍历wkbk中的所有工作表进行相同的检查?
Sub remove_columns()
For i = ActiveSheet.Columns.Count To 1 Step -1
If InStr(1, Cells(1, i), "Status") Then Columns(i).EntireColumn.Delete
Next i
End Sub
3 个解决方案