Hey guys,
How would I edit the line
If .Value <> "Public relations" Then .EntireRow.Delete
to include more than one value?
I have variations of "Public Relations" that include "Public relations;Attorneys" etc. and they get deleted when I run my macro..
Sub PublicRelationsOnly()
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.Cells(1).Row
Lastrow = .UsedRange.Rows(.UsedRange.Rows.Count).Row
For Lrow = Lastrow To Firstrow Step -1
With .Cells(Lrow, "BC")
If Not IsError(.Value) Then
If .Value <> "Public relations" Then .EntireRow.Delete
End If
End With
Next Lrow
End With
ActiveWindow.View = ViewMode
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub
I know its probably something simple, but I'm still pretty lost when it comes to this stuff..
Thanks in advance
Bookmarks