Hello,
I have a project that I'm working on and stuck at trying to figure this part out. It is in a larger database of information and I need a macro that will analyze one column of data and delete the entire row if it's value is under 30 sec.
Help!
you dont say which column to look at so you can adjust this yourself!
Sub Del_If_under_30() 'Code supplied by Simon Lloyd '19/11/2010 'Microsoft Office Help 'Excel Conference Poll Dim rRow As Double, i As Double rRow = Range("A" & Rows.Count).End(xlUp).Row For i = rRow To 1 Step -1 If Range("A" & rRow).Value < 30 Then Rows(rRow).EntireRow.Delete End If Next i End Sub
Not all forums are the same - seek and you shall find
With this one you can do the action for any selection of yours...
Option Explicit Sub delete() Dim dvalue As Double Dim cell As Range For Each cell In Selection If ActiveCell.Value < 30 Then ActiveCell.EntireRow.delete ActiveCell.Offset(-1, 0).Activate End If ActiveCell.Offset(1, 0).Activate Next cell End Sub
Not all forums are the same - seek and you shall find
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks