#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete the test values, but do not delete the formulas kathy Excel Discussion (Misc queries) 1 February 21st 07 07:03 PM
How can I delete a macro when the Delete button is not active? FCR Excel Worksheet Functions 0 March 9th 06 09:43 AM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
How do i delete a macro in Excel 2003 when delete isn't highlight Abel Excel Discussion (Misc queries) 2 September 13th 05 04:09 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM


All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"