+ Reply to Thread
Results 1 to 10 of 10

Remove lines based on cell value (remove lines in range, not entire row)

  1. #1
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    174

    Remove lines based on cell value (remove lines in range, not entire row)

    Hi,

    I would like to find VBA code, which should remove cells in range "J-N" based on positive value in column N and Shift cells out. As result there will be listed only items with negative value).

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-18-2015
    Location
    Madrid
    MS-Off Ver
    2016
    Posts
    95

    Re: Remove lines based on cell value (remove lines in range, not entire row)

    This worked for me:

    Please Login or Register  to view this content.
    See also the attached file.
    Attached Files Attached Files
    excelbat.com: free Excel tools, macros...

  3. #3
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    174

    Re: Remove lines based on cell value (remove lines in range, not entire row)

    Thank you very much, my friend. It works for me as welll.

  4. #4
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    174

    Re: Remove lines based on cell value (remove lines in range, not entire row)

    Unfortunately I have to reopen this topic since I founded, that I forgot for one very important condition in my request.

    As I already mentioned your macro code works perfectly but I have to update my request as follows:

    - I have to see items in negative values but once subtotal of appropriate item in column "J" is negative. Just fyi column "J" represents customer number. Could you pls help me to update your code?

  5. #5
    Registered User
    Join Date
    11-18-2015
    Location
    Madrid
    MS-Off Ver
    2016
    Posts
    95

    Re: Remove lines based on cell value (remove lines in range, not entire row)

    Hi! I think this new version meets your requirements.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    174

    Re: Remove lines based on cell value (remove lines in range, not entire row)

    Hi, partially it is ok, if I check the final amount as the result. But I need to keep also positive value for these customers.
    Let me show it on example for customer# 391793197. Total amount is negative (-597,081.27) but for my purposes I have to see all lines since there are different GAxx indicators (GA02,GA30,GA1C), which are required for my next reporting.


    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-18-2015
    Location
    Madrid
    MS-Off Ver
    2016
    Posts
    95

    Re: Remove lines based on cell value (remove lines in range, not entire row)

    Hi, this should work.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    174

    Re: Remove lines based on cell value (remove lines in range, not entire row)

    Excellent! This is exactly what I need. I really appreciate your help. Thank you, man.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: Remove lines based on cell value (remove lines in range, not entire row)

    Try this
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    174

    Re: Remove lines based on cell value (remove lines in range, not entire row)

    Hi jindon, thanks a lot for your effort, however I already got solution from excel_bat. Anyway thanks a lot for your support.

+ 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. [SOLVED] Remove Lines Based on Key Lookup
    By gkenens in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-30-2015, 03:53 PM
  2. [SOLVED] Macro neede to open text files from folder and remove all the lines except specific lines
    By genetist in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-07-2014, 02:44 AM
  3. [SOLVED] Macro to remove certain lines based on barcode format
    By ciuncky in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-10-2014, 07:38 AM
  4. [SOLVED] remove lines if a cell is blank
    By Christopherdj in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-01-2013, 10:08 PM
  5. .CSV, remove multiple lines in one cell
    By christianlie in forum Excel General
    Replies: 1
    Last Post: 10-21-2011, 09:44 PM
  6. How to remove these lines
    By Little Master in forum Excel General
    Replies: 2
    Last Post: 10-23-2008, 06:33 AM
  7. [SOLVED] remove blank lines from an entire spreadsheet
    By mdeanda in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-21-2005, 09:06 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