Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Macro needed to identify value and delete row if value below targe
I need a macro that will locate a numeric value in column J only, and if that
value is less than 15, the entire row on which that value is located will be deleted. Thank you. |
#2
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Macro needed to identify value and delete row if value below targe
Give this macro a try...
Sub RemoveRowsLessThan15() Dim X As Long With Worksheets("Sheet1") For X = .UsedRange.Rows.Count To 1 Step -1 If IsNumeric(.Cells(X, "J").Value) Then If .Cells(X, "J").Value < 15 Then .Rows(X).Delete End If Next End With End Sub -- Rick (MVP - Excel) "Pyrotoy" wrote in message ... I need a macro that will locate a numeric value in column J only, and if that value is less than 15, the entire row on which that value is located will be deleted. Thank you. |
#3
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Macro needed to identify value and delete row if value below targe
Sub killsmall()
n = Cells(Rows.Count, "J").End(xlUp).Row For j = n To 1 Step -1 If Cells(j, "J").Value < 15 Then Cells(j, "J").EntireRow.Delete End If Next End Sub -- Gary''s Student - gsnu200819 |
#4
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Macro needed to identify value and delete row if value below t
Rick: Works perfectly. Thanks for the fast response. Best wishes, Scott
"Rick Rothstein" wrote: Give this macro a try... Sub RemoveRowsLessThan15() Dim X As Long With Worksheets("Sheet1") For X = .UsedRange.Rows.Count To 1 Step -1 If IsNumeric(.Cells(X, "J").Value) Then If .Cells(X, "J").Value < 15 Then .Rows(X).Delete End If Next End With End Sub -- Rick (MVP - Excel) "Pyrotoy" wrote in message ... I need a macro that will locate a numeric value in column J only, and if that value is less than 15, the entire row on which that value is located will be deleted. Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I identify matching rows of data and delete them both? | Excel Discussion (Misc queries) | |||
Need to identify active worksheet in macro | Excel Worksheet Functions | |||
Identify the duplicate and delete with details in excel | Excel Discussion (Misc queries) | |||
How do I build a Macro that can identify wooksheet names | Excel Discussion (Misc queries) | |||
How can I have excel search and add multiple cells to find a targe | Excel Discussion (Misc queries) |