+ Reply to Thread
Results 1 to 13 of 13

Deleting complete row when content in a column

  1. #1
    Registered User
    Join Date
    10-01-2009
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Deleting complete row when content in a column

    I have a mailing list that was produced from a database but I only want to send to people in rows that dont have an email address in column F.

    I need a formula that will delete all rows that contain an email address in
    Col F.

    Can anyone help.

    Thanks

  2. #2
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Deleting complete row when content in a column

    Is there anything else that's going to be anywhere in column F, or would it be safe to say:
    If the cell at row x, column F is not blank, delete row x.

    mew?

    If so, run something like:
    Please Login or Register  to view this content.
    mew!

    That's a macro by the way.
    Just lemme know if you need to know what to do with that.

    wait...
    that sounded a lot dirtier than it was supposed to...
    Last edited by mewingkitty; 11-05-2009 at 06:34 PM.
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

  3. #3
    Registered User
    Join Date
    10-01-2009
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Deleting complete row when content in a column

    I am sorry, having trouble working out what you are asking! I have had a really bad day!

    What I think you are asking is if there is any other info in Col F. I have something like 1000 rows, and 500 of them have an email address in them and the other 500 are blank.

    I want to delete any that are not blank and keep the rows that are blank in col F - Yes thats it! Sorry had to write/type it down to work out, think I need to go have a sleep.

    Thanks

  4. #4
    Registered User
    Join Date
    10-01-2009
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Deleting complete row when content in a column

    I dont understand the formula. I think it is beyond my knowledge, you are writing things like the word 'Dim' I am Dim because I dont know it. I know some of the basic formulas and some of the IF formulas but thats it. When you write VBNullstring, then - I am lost :-( Sorry but thanks for trying with a dim wit here!

  5. #5
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Deleting complete row when content in a column

    Oh, don't be so hard on yourself.
    We all started with =A1+B1

    In your workbook:

    Click on your windows button, the one you use to save a file.

    On the bottom of that drop down window, click "Excel Options"

    In the "Popular" tab, there should be an option that says "Show the developer tab in the ribbon". Check that box

    Close the options screen

    On the top of your window there will now be a tab called "Developer" on the far right. Click on that tab.

    Click on the button that says "Macros"

    Enter a name for your macro, call is something simple with no spaces, like: DeleteRows

    Click on the button on the right of that window that says "Create"

    Copy and paste what I've posted in that box there with all the gibberish language. Paste it in the row inbetween "Sub DeleteRows()" and "End Sub"

    That should now look like this:

    Please Login or Register  to view this content.
    Now on that same screen, above the white area you just pasted that into, there's a little green triangle that looks like a play button. When you mouse over it, it should say "Run Sub/Userform (F5)"

    Press that button.

    Zing.
    Note that you should save your workbook under a new name, as this can not be undone. If you save over your original workbook, those email addresses that we just deleted are toast. If you don't need them EVER, then go ahead and save over it.

    Hope that helps.

    mew!
    Last edited by mewingkitty; 11-05-2009 at 06:58 PM.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Deleting complete row when content in a column

    Mew...be sure to include "how to use a macro" instructions when you post macros in the non-programming forums. And the code should probably be all-inclusive...names and all.

    ======
    How to use the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save your sheet

    The macro is installed and ready to use. Press Alt-F8 and select it from the macro list.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Deleting complete row when content in a column

    A non-macro way to do it with Excel's AutoFilter.

    1) Make sure the top of the data has "titles" in it, if not, add titles.
    2) Click on the title row (row1?) and select Data > Filter > AutoFilter to turn it on
    3) Click on the dropbox for column F and select NON-BLANKS
    4) Highlight all the rows you still see and delete them all (Edit > Delete
    5) Turn off the Autofilter, same way you turned it on.

    Now you have only rows that are blank in column F left.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Deleting complete row when content in a column

    Quote Originally Posted by mewingkitty View Post
    Click on your windows button, the one you use to save a file.

    On the bottom of that drop down window, click "Excel Options"

    In the "Popular" tab, there should be an option that says "Show the developer tab in the ribbon". Check that box
    I believe those are all Excel 2007 terms and features, not available in Excel 2000.

  9. #9
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Deleting complete row when content in a column

    Alright so I'm an idiot.
    This is not late breaking news. :P
    sry!

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Deleting complete row when content in a column

    Not at all. I forget to include those instruction in the non-programming forums all the time and have to go back and add them. Go team...

  11. #11
    Registered User
    Join Date
    10-01-2009
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Deleting complete row when content in a column

    Mewingkitty, you're a genious not an idiot, in my opinion :-)

    Ok, I guessed your were advising on 2007 and although my boss is getting me that for Christmas, I am still on 2000. I managed to work my way through the 2000 with your instructions and I have deleted all my email lists, hopefully thats all!!! I went Tools, Macros, record new macro and gave it the name you advised, a shortcut key and pressed ok. Then I hit Alt + F8 (seen that somewhere earlier) When it brought up the box I pressed either edit or run and it brought up the macro so I could delete what was there and copied and pasted you info so it all looked the same! The pressed the play button on the menu bar and it all just happened :-)

    I wonder if I can ask what it all meant though, if you have time! I was looking for something like deleterows ???? F1:F1000 That macro stuff doesnt even mention my col. Are you able to explain it or is this too complicated and I just need to continue my learning process?

    Now off to try understand what the other guy is saying about programming!

    Thanks so much for your help, I will write it all down.

    Nikky

  12. #12
    Registered User
    Join Date
    10-01-2009
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Deleting complete row when content in a column

    Ok guys, I got it all now, even using jbeaucaire instructions and with the filter.

    Thank you so much, both of you, very helpful and very much appreciated.

    Nikky

  13. #13
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Deleting complete row when content in a column

    Glad to hear it.

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ 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