+ Reply to Thread
Results 1 to 7 of 7

Macro needed to delete rows based on values

  1. #1
    Registered User
    Join Date
    08-12-2010
    Location
    hong kong
    MS-Off Ver
    Excel 2003
    Posts
    3

    Macro needed to delete rows based on values

    Hi, im trying to write a macro that deletes a row if certain cell contains a specific value. I have some basic experience with programing but i don't know visual basic at all, can someone how me how to do the following:

    starting from Row 7,

    if value in J does Not equal Closed or value in L equal MA, delete row.

    move to next row

    stop when row is empty (at the end).

    thanks!
    Last edited by romperstomper; 08-12-2010 at 06:22 AM. Reason: Amend title and mark solved

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: new to Macros, need some help =)

    You can do it like this:

    Please Login or Register  to view this content.

    Dom
    Last edited by Domski; 08-12-2010 at 03:51 AM.
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: new to Macros, need some help =)

    First things first, you should really pick a more descriptive name for your thread title, but, moving on...

    Please Login or Register  to view this content.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: new to Macros, need some help =)

    Hi, and welcome to the forum.

    However:

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    08-12-2010
    Location
    hong kong
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: THANKS FOR THE HELP!

    thanks alot guys!! works perfectly.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: THANKS FOR ALL THE HELP!! :) problem solved

    Don't change the Thread Title like this!

    If you don't want to follow the Forum Rules then don't post
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Macro needed to delete rows based on values

    FYI, I've undeleted the two original responses and altered the thread title since the whole thing makes no sense otherwise.

    bensun - please note Roy's comment for future posts, or we may not be so lenient.

+ 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