+ Reply to Thread
Results 1 to 18 of 18

Conditionally compare the data & delete entire row

  1. #1
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Conditionally compare the data & delete entire row

    Hi, I am looking for a macro that will do the things as mentioned below

    If column J of 1.xls has buy & column H of 1.xls is not greater than column D of 1.xls then match column I data of 1.xls with column B of alert.csv and if it matches then delete that entire row of alert.csv
    If column J of 1.xls has a blank cell then match column I data of 1.xls with column B of alert.csv and if it matches then delete that entire row of alert.csv
    If column J of 1.xls has short & column H of 1.xls is Greater than than column D of 1.xls then match column I data of 1.xls with column B of alert.csv and if it matches then delete that entire row of alert.csv



    These are the three condition that macro will follow and based on that it will work
    all files are located in different path, macro will be placed in separte file macro.xlsm
    sheet name can be anything
    Attached Files Attached Files

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

    Re: Conditionally compare the data & delete entire row

    This will create new a csv file named (Original File Name_Filtered.csv) in the same folder.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Conditionally compare the data & delete entire row

    Thnx Jindon Sir but as i mentioned that all files are located in different path, macro will be placed in separte file macro.xlsm

    So this macro needs some changes so plz relook sir

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

    Re: Conditionally compare the data & delete entire row

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Conditionally compare the data & delete entire row

    Please Login or Register  to view this content.

    I changed the code, i need something like mentioned above , i don't want any popup to select a file, it should automatically select the file
    So plz have a relook Sir & help me in solving this problem Sir

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

    Re: Conditionally compare the data & delete entire row

    Your change doesn't make sense.

    Just post correct full name of the files.

  7. #7
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Conditionally compare the data & delete entire row

    1.xls & Alert..csv & macro is placed in macro.xlsm

    Actually i want to automate the same, using of get open file in vba will force me to select the file & i dont want that , it should automatic select file
    Last edited by dumdumbum; 05-29-2020 at 03:55 AM.

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

    Re: Conditionally compare the data & delete entire row

    What is the full path of the csv file?

  9. #9
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Conditionally compare the data & delete entire row

    C:\Users\WolfieeeStyle\Desktop

    But in future i will change that & i will edit the same in macro too..

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

    Re: Conditionally compare the data & delete entire row

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Conditionally compare the data & delete entire row

    I haven't got any error But i am not getting any result from it
    As i mentioned, row 3 & row 4 & row 5 will be deleted after runing the macro in Alert..csv file but it doesnt happened
    Plz run the macro in the sample file which i attached

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

    Re: Conditionally compare the data & delete entire row

    Quote Originally Posted by jindon View Post
    This will create new a csv file named (Original File Name_Filtered.csv) in the same folder.
    ..............

  13. #13
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Conditionally compare the data & delete entire row

    I have no issue it will create a new file
    But the problem is where is the output of macro , is the output of the macro matches as i mentioned in sample file that if condition match then delete entire row



    I am not getting any output in the new file created by this macro
    Last edited by dumdumbum; 05-29-2020 at 04:21 AM.

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

    Re: Conditionally compare the data & delete entire row

    How can I?

    Check it for yourself.

    It should be in the same folder where original csv is located.

  15. #15
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Conditionally compare the data & delete entire row

    No doubt, Sure Jindon Sir, after checking the output in the new file created by the macro, I am notifying u about the same sir
    So it is my request plz have a relook & help me in solving this problem

    Plz run the macro on the sample file that i have attached & then see the output

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

    Re: Conditionally compare the data & delete entire row

    Missed 3 dots.
    Please Login or Register  to view this content.

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

    Re: Conditionally compare the data & delete entire row

    If that takes care of your original question, select Thread Tools from the menu link above and mark this thread as SOLVED.

  18. #18
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Conditionally compare the data & delete entire row

    Awesome Bro Awesome
    Thnx Alot Jindon Sir for ur Great Help, No Doubt Problem Solved
    Have a Great Day

+ 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. Transposing data conditionally in an entire column
    By encid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2017, 09:17 AM
  2. Replies: 1
    Last Post: 01-04-2017, 06:00 PM
  3. Replies: 1
    Last Post: 01-04-2017, 05:59 PM
  4. Default Compare 2 sheets and delete entire row if don't match
    By lapot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2016, 02:27 PM
  5. [SOLVED] Compare two columns to check if difference is less then 100 then delete entire row..
    By tissumon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-01-2014, 09:42 PM
  6. Compare two cells, if blank delete entire row
    By taichi56 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2013, 02:05 PM
  7. Replies: 6
    Last Post: 05-24-2012, 09:14 AM

Tags for this Thread

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