Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Row deletion debug

Dim rngRange as Range
Dim dteDate as Date
Set rngRange = ActiveSheet.UsedRange.Columns(3)

For lngR = rngRange.Rows.Count To 1 Step -1
dteDate = Cells(lngR,"C").Value
If Format(dteDate, "M") = 8 Then
Rows(lngR).EntireRow.Delete
End If
Next lngR

--
Regards,
Tom Ogilvy


"raj" wrote in message
...

Hello, I hope someone can help me debug the following. It
is supposed to delete rows when a date column is in August
(8). The program runs without generating any errors, but
it also fails to do anything:

dteMonth = DateSerial(Year(Date), 8, Day(Date))
Set rngRange = ActiveSheet.UsedRange.Columns(3)

For lngR = rngRange.Rows.Count To 1 Step -1
If rngRange.Rows(lngR).Offset(0, _
-2).FormulaR1C1 _
Like "###.###.####.######.###.##.###" Then _
dteDate = DateSerial(Year(rngRange.Rows
(lngR).Value), Month(rngRange.Rows(lngR).Value), Day
(rngRange.Rows(lngR).Value))
If Format(dteDate, "M") = Month(dteMonth) Then
rngRange.Rows(lngR).EntireRow.Delete
End If
Next lngR

Sorry its so choppy, I can't do much with this editor.
Thanks in advance for your assistance.



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
Debug Error Saxman Excel Discussion (Misc queries) 3 August 11th 08 12:42 PM
Debug on userform Jase Excel Discussion (Misc queries) 1 May 28th 08 05:00 PM
DeBug Ollie Excel Discussion (Misc queries) 4 April 28th 06 03:17 PM
help with debug Rusty New Users to Excel 3 February 2nd 05 03:16 AM
debug help Tom Ogilvy Excel Programming 0 August 27th 03 07:10 PM


All times are GMT +1. The time now is 11:59 PM.

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"