Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Macro to delete certain rows

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Williston ND
    Posts
    55
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Yes I like it. Changed it some what to suit my needs. Thx alot. INT() is a new one for me I can use that alot. Remember to save first or it will get ugly.

    Been gone awhile
    Paul

  2. #2
    Board Regular
    Join Date
    Apr 2002
    Location
    Williston ND
    Posts
    55
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am sure this has been covered but I not getting any results on the search. I would like a macro to look down a column of numbers (10,000 rows)and delete the entire row (or hide the row) that doesn't have a whole number in it. Like this:
    240.00 keep row
    256.02 delete row
    564.46 delete row
    560.00 keep row
    ............
    there are 2 other columns of numbers along side the row in question, and those numbers would be deleted or (hide) along with the non whole numbers.
    Is this possible.
    I tried endlessly but my macro ability is early beginer at best. And with so many command choices....well you know.

    Paul

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Assuming your numbers are in column A ;-

    Dim rng As Range
    Set rng = Range([A1], [A65536].End(xlUp))
    rng.EntireColumn.Insert
    With rng.Offset(0, -1)
    .FormulaR1C1 = "=IF(RC[1]-INT(RC[1])=0,1,"""")"
    On Error Resume Next
    .SpecialCells(xlCellTypeFormulas, 2).EntireRow.Delete
    On Error GoTo 0
    .EntireColumn.Delete
    End With

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •