0
我有这段代码删除所有只有在D列中具有单词“服务塔”的行。我想要的是能够删除更多的行,这些行也具有“流媒体播放“,”数据集“等等,无论它们在哪里,都包含这些文本。无论他们在a栏,b栏还是c栏到z栏。我希望有人能够帮助我编辑我的代码,以便能够添加“服务塔”以外的其他单词。先谢谢你!基于值或文本删除行的VBA /宏
Sheets("database").Select
Dim Firstrow As Long
Dim Lastrow As Long
Dim Lrow As Long
Dim CalcMode As Long
Dim ViewMode As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ActiveSheet
.Select
ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView
.DisplayPageBreaks = False
Firstrow = .UsedRange.Rows(2).Row
Lastrow = .UsedRange.Rows(.UsedRange.Rows.Count).Row
For Lrow = Lastrow To Firstrow Step -1
With .Cells(Lrow, "D")
If Not IsError(.Value) Then
If .Value = "Service Tower" Then .EntireRow.Delete
End If
End With
Next Lrow
End With
ActiveWindow.View = ViewMode
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
MsgBox "Report Completed!"
End Sub
谢谢!如果我有一些问题,我会探索更多并回来 – proxyflow