第0张:https://paste.pics/82a491cbc642d6fff555ef70612aec5b
第1张:https://paste.pics/cafe8628b76e56789cf03b06a923bde8
第二页:https://paste.pics/2320369d395a22c868b5e439b456ad3a
第3张:https://paste.pics/9fc84c7f43e1a2819d1537593c44c1f9
如果找到匹配项=> “ SUP”“ AL”“ AP” ,则应通过一次单击从所有工作表中清除数据 按钮在“ Sheet0”中=>清除数据时,标题不应该清除
如果要查看我的excel安全下载100%
https://drive.google.com/file/d/1w0n_srbhF02OhiWzKsB4IWWiwV5nO-Vl/view?usp=sharing
================================================ ========================= 这是我尝试的代码,但是在 Ws.Range
处出现错误Private Sub CommandCreate_new_Click()
Dim Ws As Worksheet
For Each Ws In Sheets(Array("Sheet1","Sheet2","Sheet3"))
Ws.Range ("I9:AM9")
.Cells.Replace what:=UCase("SUP"), Replacement:="", ReplaceFormat:=True
.Cells.Replace what:=UCase("SUP"), Replacement:="", ReplaceFormat:=False
.Cells.Replace what:=UCase("AL"), Replacement:="", ReplaceFormat:=True
.Cells.Replace what:=UCase("AL"), Replacement:="", ReplaceFormat:=False
Next Ws End Sub
================================================ =======================
部分工作,但未将单元格设置为=>无填充颜色[发现匹配条件后,应删除数据,甚至应删除单元格颜色并将其设置为无填充颜色] >
Private Sub CommandButton1_Click()
Dim Ws As Worksheet
For Each Ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3"))
Ws.Range("A4", Ws.Range("A" & Rows.Count).End(xlUp).Offset(, 1)).ClearContents
Ws.Range("B4", Ws.Range("B" & Rows.Count).End(xlUp).Offset(, 1)).ClearContents
Ws.Range("C4", Ws.Range("C" & Rows.Count).End(xlUp).Offset(, 1)).ClearContents
Ws.Range("D4", Ws.Range("D" & Rows.Count).End(xlUp).Offset(, 1)).ClearContents
Ws.Range("E4", Ws.Range("E" & Rows.Count).End(xlUp).Offset(, 1)).ClearContents
Ws.Range("F4", Ws.Range("F" & Rows.Count).End(xlUp).Offset(, 1)).ClearContents
Ws.Range("G4", Ws.Range("G" & Rows.Count).End(xlUp).Offset(, 1)).ClearContents
Ws.Range("H4", Ws.Range("H" & Rows.Count).End(xlUp).Offset(, 1)).ClearContents
Ws.Range("I4", Ws.Range("I" & Rows.Count).End(xlUp).Offset(, 1)).ClearContents
Ws.Range("J4", Ws.Range("J" & Rows.Count).End(xlUp).Offset(, 1)).ClearContents
Next Ws
End Sub
这是我在运行上面的部分代码后得到的以下输出
[我的输出] [1]:https://i.stack.imgur.com/6EbRP.png