我对VBA编码非常陌生,我真的需要在30多个工作簿(包含250个工作表)上实现这一目标...
我需要一个VBA宏,该宏可以:
任何人都可以帮忙吗?
谢谢!
答案 0 :(得分:0)
好吧
以防万一有人通过搜索和/或google留在这篇帖子上:
我将其发布on Reddit,一个善良的灵魂给了我答案:
Sub DeleteRowsAfterFinding3()
Dim i As Long
Dim rangeFound As Range
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Set rangeFound = ws.Range("A:A").Find("SOMETHING", Lookat:=xlWhole)
If Not rangeFound Is Nothing Then
For i = rangeFound.Row + 1 To ws.UsedRange.Rows.Count
ws.Rows(rangeFound.Row + 1).Delete
Next i
End If
Next ws
End Sub