Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
截图:http: //i.imgur.com/hziit.jpg
在上图中,我试图定位所有具有“ratings_users”值的行。对于与该值匹配的所有行,我只想删除整行。我该怎么做呢?
你可以使用这样的宏:
Sub DeleteRatingsUsers() maxRow = ActiveSheet.UsedRange.Rows.Count For i = 1 To maxRow If (StrComp(ActiveSheet.Cells(i, 2).Text, "ratings_users", vbTextCompare) = 0) Then Rows(i).Select Selection.Delete Shift:=xlUp End If Next End Sub