+ Reply to Thread
Results 1 to 6 of 6

How do I delete rows based on the calculated value in the field.

  1. #1
    Registered User
    Join Date
    04-27-2012
    Location
    Melbourne, Oz
    MS-Off Ver
    Excel 2007
    Posts
    80

    How do I delete rows based on the calculated value in the field.

    In one of my, worksheets I have one field named “Product”.

    If the calculated value is 1, I want to delete that line and the two above it.

    If the calculated value is 0, then I want to delete that line only.

    How do I do it with VBA?

    Thank you

    Raghu Prabhu

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: How do I delete rows based on the calculated value in the field.

    Do it in a loop going down up
    so soemthing like
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    04-27-2012
    Location
    Melbourne, Oz
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: How do I delete rows based on the calculated value in the field.

    Kaper,

    Thanks..

    I don't know if this is right ... the column "Product" is in worksheet "MbrsDetChanged"
    Please Login or Register  to view this content.
    Regards
    Raghu
    Last edited by raghuprabhu; 05-01-2017 at 02:20 AM. Reason: to put tags.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: How do I delete rows based on the calculated value in the field.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Additionally: Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Registered User
    Join Date
    04-27-2012
    Location
    Melbourne, Oz
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: How do I delete rows based on the calculated value in the field.

    Oops...Sorry Kaper...fixed.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How do I delete rows based on the calculated value in the field.

    Maybe:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Pivot Table: Calculated Field based on Running Total Field
    By EvolvingMonkey in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-07-2016, 06:27 AM
  2. Calculated field based on Column and Row Labels
    By Joshua H in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-29-2016, 05:44 PM
  3. Pivot table - Calculated field for the data in rows.
    By 99problems in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 04-21-2016, 03:57 AM
  4. Replies: 0
    Last Post: 10-24-2013, 10:59 AM
  5. I need to sort based on a calculated field
    By r71lima in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-18-2012, 11:57 AM
  6. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  7. Replies: 0
    Last Post: 03-23-2005, 11:42 AM

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