billandrew
Well-known Member
- Joined
- Mar 9, 2014
- Messages
- 743
Afternoon
Is there a more appropriate way to delete row if value is Saturday or Sunday than the following
Sub deleteSatSun()
Dim dlrow As Long, ws As Worksheet
Set ws = ActiveSheet
For dlrow = ws.Range("B" & Rows.Count).End(xlUp).Row To 2 Step -1
If ws.Range("B" & dlrow).Value = "Sunday" Then
Rows(dlrow).EntireRow.Delete
ElseIf ws.Range("B" & dlrow).Value = "Saturday" Then
Rows(dlrow).EntireRow.Delete
End If
Next dlrow
End Sub
Is there a more appropriate way to delete row if value is Saturday or Sunday than the following
Sub deleteSatSun()
Dim dlrow As Long, ws As Worksheet
Set ws = ActiveSheet
For dlrow = ws.Range("B" & Rows.Count).End(xlUp).Row To 2 Step -1
If ws.Range("B" & dlrow).Value = "Sunday" Then
Rows(dlrow).EntireRow.Delete
ElseIf ws.Range("B" & dlrow).Value = "Saturday" Then
Rows(dlrow).EntireRow.Delete
End If
Next dlrow
End Sub