+ Reply to Thread
Results 1 to 3 of 3

Deleting rows Macro

  1. #1
    Registered User
    Join Date
    07-27-2007
    Posts
    4

    Deleting rows Macro

    I searched forums but was unable to find exactly what I am in need of. I am looking to find and delete email addresses in this case *@aol.com. I have only one column which is full of email addresses, I just want to delete all of the @aol.com ones in this case. This is the macro I am trying to use, but it does not work.

    For Each cell In Range(Range("a2"), Range("a65536").End(xlUp))
    If cell = "*@aol" Then
    Range(cell, Cells(1, Rows.Count)).EntireRow.Delete
    Exit For
    End If
    Next cell

    It has been awhile since I have created a macro so anyhelp at all would be good.

    Thank you

    Nox

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Nox,

    Here is the macro. You were very close.
    Please Login or Register  to view this content.
    To Install the Macro:
    1. Copy the Macro code above using CTRL+C
    2. Open Excel and Right Click on any Sheet Tab
    3. Click on View Code in the pop up menu
    4. Use ALT+I to activate the VBE Insert Menu
    5. Press the letter m to insert a Standard Module
    6. Paste the macro code using CTRL+V
    7. Save the macro using CTRL+S
    8. Close the VBE and return to excel using ALT+Q

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    07-27-2007
    Posts
    4

    Talking

    Leith,

    Huge thanks, it works like a charm.


    Nox

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1