Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I have a worksheet "Filtered OSMI". I want a macro to go through each row, and if the entry in column D is less than 50, I want to delete that row. The same process should run until I hit a blank cell in column D. I tried the following macro, but it given the error "Application-defined or object-defined error". Could you tell me what I am missing here? Sub OSMIvalcheck() Dim c As Range 'current Dim N As Range 'next Dim dolval As Variant Dim i As Variant Set c = Worksheets("Filtered OSMI").Range("A2") i = 2 Do While Not IsEmpty(c) Sheets("Filtered OSMI").Select dolval = Worksheets("Filtered OSMI").Cells(i, "D").Value If dolval < 50 Then Range(i, "D").EntireRow.Delete Else Set N = c.Offset(1, 0) Set c = N i = i + 1 End If Loop End Sub Thanks, Joe. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro error after switching from Excel 2000 to Excel 2003 | Excel Discussion (Misc queries) | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
run macro error, please help | Excel Discussion (Misc queries) | |||
macro error when opening any file | Excel Discussion (Misc queries) | |||
macro error at cell | Excel Worksheet Functions |