Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete a row
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete a row
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) "kevcar40" wrote in message ups.com... 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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete a row
On 1 Mar, 10:38, "Bob Phillips" wrote:
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) "kevcar40" wrote in message ups.com... 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- Hide quoted text - - Show quoted text - Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
delete the test values, but do not delete the formulas | Excel Discussion (Misc queries) | |||
How can I delete a macro when the Delete button is not active? | Excel Worksheet Functions | |||
How to Delete a Range in Closed Workbook (to Replace Delete Query) | Excel Discussion (Misc queries) | |||
How do i delete a macro in Excel 2003 when delete isn't highlight | Excel Discussion (Misc queries) | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions |