billandrew
Well-known Member
- Joined
- Mar 9, 2014
- Messages
- 743
I have the following code to delete a row if the value in column C is Monday. My question is, if there is no Monday value will there be an issue, so far I have run the code and I do not see any problems. Is there an alternative.
Thank You
Code
Sub DeleteMonday()
Dim lr As Long
Dim w As Long
Sheets("Sheet1").Activate
lr = Range("C" & Rows.Count).End(xlUp).Row
For w = 2 To lr
If Cells(w, "C").Value = "Monday" Then
Cells(w, "C").EntireRow.Delete
End If
Next w
End Sub
Thank You
Code
Sub DeleteMonday()
Dim lr As Long
Dim w As Long
Sheets("Sheet1").Activate
lr = Range("C" & Rows.Count).End(xlUp).Row
For w = 2 To lr
If Cells(w, "C").Value = "Monday" Then
Cells(w, "C").EntireRow.Delete
End If
Next w
End Sub
Last edited: