Delete a row

  • Thread starter Thread starter kevcar40
  • Start date Start date
K

kevcar40

Hi
I am want to delete a row of information depending on the value of a
cell

If cell in column CN is equal to Saturday or sundayi want to delete
that row off data
i am trying to use the code below

ThisWorkbook.Worksheets("Working").Select
Set rng = Intersect(Columns(92), ActiveSheet.UsedRange)
rng.SpecialCells(xlBlanks).EntireRow.Delete
LastRow = ActiveSheet.UsedRange.Rows.Count
On Error GoTo 0
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "CN").Value = 0 Then
Rows(RowNdx).Delete
End If
Next RowNdx

How can i adapt this code to delete the required rows

thanks

kevin
 
ThisWorkbook.Worksheets("Working").Select
Set rng = Intersect(Columns(92), ActiveSheet.UsedRange)
rng.SpecialCells(xlBlanks).EntireRow.Delete
LastRow = ActiveSheet.UsedRange.Rows.Count
On Error GoTo 0
For RowNdx = LastRow To 1 Step -1
If Weekday(Cells(RowNdx, "CN").Value, 2) > 5 Then
Rows(RowNdx).Delete
End If
Next RowNdx


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
ThisWorkbook.Worksheets("Working").Select
Set rng = Intersect(Columns(92), ActiveSheet.UsedRange)
rng.SpecialCells(xlBlanks).EntireRow.Delete
LastRow = ActiveSheet.UsedRange.Rows.Count
On Error GoTo 0
For RowNdx = LastRow To 1 Step -1
If Weekday(Cells(RowNdx, "CN").Value, 2) > 5 Then
Rows(RowNdx).Delete
End If
Next RowNdx

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)









- Show quoted text -

Thank you
 
Back
Top