+ Reply to Thread
Results 1 to 6 of 6

How to delete rows if set parameter is satisfied

  1. #1
    Registered User
    Join Date
    08-09-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    How to delete rows if set parameter is satisfied

    I am working in a workbook, where i want to be able to delete certain rows of data, depending on a variable cell.
    For example, in the attached excel file, im trying to write a macro to delete all rows in the table which do not have the 'cardcode' outlined in A1.

    I have managed to hide all cell, but cannot seem to delete.

    It goes without saying, that any help will be greatly appreciated!

    Thanks.Book1.xlsx

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to delete rows if set parameter is satisfied

    Maybe, you can also show is the used code for hide all cells.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    08-09-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How to delete rows if set parameter is satisfied

    Here is the current macro to hide cells;

    Please Login or Register  to view this content.
    Thanks in advance,
    A
    Last edited by Cutter; 08-09-2012 at 03:37 PM. Reason: Added code tags

  4. #4
    Forum Contributor
    Join Date
    11-26-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    159

    Re: How to delete rows if set parameter is satisfied

    hi try this,

    Please Login or Register  to view this content.

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to delete rows if set parameter is satisfied

    @ Adam1987

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to delete rows if set parameter is satisfied

    @mmmarks

    I tested youre code and i think it only deletes the first 3 rows.

    Maybe I did it wrong, but I get no failure messages.

    Wil anyone explain to me if i'm wrong?

+ 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