Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Debug Error | Excel Discussion (Misc queries) | |||
Debug on userform | Excel Discussion (Misc queries) | |||
DeBug | Excel Discussion (Misc queries) | |||
help with debug | New Users to Excel | |||
debug help | Excel Programming |