Link to home
Start Free TrialLog in
Avatar of William C Johnson
William C JohnsonFlag for United States of America

asked on

Delete a Row When a Cell Encounters a Period

See attached worksheet.  Presentation section: I need a simple macro that will look for a period in column A.  When if finds the cell containing the period, then I want the row deleted.  This macro must loop until if finds the first blank cell in the column then stop.  This requirement is not for the entire column length.

This is the macro I recorded but I don’t know how to control it with If statements so that if it finds what I’m looking for, then perform the row deletion.  If it does not find the search then move to the next cell down.  I’m using the search function below but I’m sure there is a better way.

    Cells.Find(What:=".0", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
        , SearchFormat:=False).Activate
    ActiveCell.Rows("1:1").EntireRow.Select
    Selection.Delete Shift:=xlUp
    ActiveCell.Select

The second macro I need is for the Change Controls section only.  It will look for any cell in the next grouping that does not contain a period in column A.  When if finds the condition, then I want the row deleted.  This macro must loop until if finds the next blank cell and stop.  This requirement is not for the entire column.

The bottom line to all of this is to remove the items in the Presentation Section that have a period and something following.  I don’t need the decimal point items.  In the Change Control section, I want the non-decimal point items removed.
Test---FIND-DELETE.xlsm
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial