在所有工作表中运行宏

时间:2019-07-06 18:04:57

标签: excel vba

Sub MisRec()
Dim ws As Worksheet
For Each ws In Worksheets
        Cells.Find(What:="abc", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
        , SearchFormat:=False).Activate
    ActiveCell.Offset(-2, 0).Select
    Range(ActiveCell, "A2").Select
    Selection.EntireRow.Delete
Next ws
End Sub

这是我现在拥有的代码,不适用于我。

1 个答案:

答案 0 :(得分:0)

您需要更明确地说明要搜索的位置,并且还应该在继续之前测试是否发现了某些东西:

struct Pokemon
{
    int id;
    std::string name;
    std::string skill;
};
相关问题