Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings, I have some mixed results with these formulas. I can more easily complete this if it's on the active sheets, but since my macro will be launched from Worksheet ("72 Hr"), I need it to apply only to worksheet ("FIDS Inbound"). I don't think I need to identify any columns since the words identified below can only happen in certain ranges, so it would be the entire worksheet ("Inbound FIDS") it could apply to. The words would be "UPDATED BY:", "POST", and "FOREIGN". Currently I'm working with three macros, but I think it could be consolidated into one macro. The codes I have now are as follows: Thank you,
VBA Code:
Sub Delete_Post()
Dim rng As Range
Set rng = Sheets("Inbound FIDS").UsedRange
For I = rng.Cells.Count To 1 Step -1
If rng.Item(I).Value = "*POST*" Then
rng.Item(I).EntireRow.delete
End If
Next I
End Sub
Sub Delete_Foreign()
Dim rng As Range
Set rng = Sheets("Inbound FIDS").UsedRange
For I = rng.Cells.Count To 1 Step -1
If rng.Item(I).Value = "*Foreign*" Then
rng.Item(I).EntireRow.delete
End If
Next I
End Sub
Sub Delete_Update()
Dim rng As Range
Set rng = Sheets("Inbound FIDS").UsedRange
For I = rng.Cells.Count To 1 Step -1
If rng.Item(I).Value = "UPDATED BY:" Then
rng.Item(I).EntireRow.delete
End If
Next I