Results 1 to 10 of 30

Thread: Delete rows based on match criteria in two excel files, 1 might be .csv file .Opened in Excel=Fail Chaos

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #23
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10

    Conditionally compare the data & delete entire row

    Quote Originally Posted by fixer View Post
    ..After runing macro this result is incorrect, after runing the macro only 3rd row and 4th row will be deleted, rest ….see the sample file which i have attached fr understanding purpose
    My result is perfect, it does exactly what you asked for. You screwed up again! – I already asked you to check – as always I was wasting my time – you rush in like a Bull in a China shop paste some crap nonsense and read nothing … I said check:
    Quote Originally Posted by DocAElstein View Post
    ..

    Are you sure??
    Please check here: https://excelfox.com/forum/showthrea...ll=1#post13430
    Hey Dude, you said :
    Quote Originally Posted by fixer View Post
    ...
    If column H of 1.xls is greater than column D of 1.xls then calculate 1% of column D of 1.xls & add it to column D of 1.xls and compare column D of 1.xls with column I of 1.xls & if column D of 1.xls is greater than column I of 1.xls ......
    You wrote in post #1 column I

    Now, , in you last uploaded file, Post #4 you write….. First we will check column D is greater than Column H or column D is lower than column H, here column D is lower then column H, so If column D is lower than column H then we will calculate the 1% of column D, so 1% of column D is 11.72 so we will add 11.72 with column D so the total value of column D is 1183.72, so now we will compare 1183.72 with column H,If column H is lower than 1183.72 …

    Do you see?? – you asked for column I ….so I gave you that
    Code:
                If arrWs(Cnt, 4) > arrWs(Cnt, 9) Then ' If column D of 1.xls is greater than column I of 1.xls 
    But you want Column H, like this:
    Code:
                If arrWs(Cnt, 4) > arrWs(Cnt, 8) Then ' If column D of 1.xls is greater than column H of 1.xls
     

    If you make that change and run the macro, you get this: - Entire row of row 3 & row 4 both is deleted after running the macro:
    NSE,236,6,>,431555,A,,,,,GTT
    NSE,25,6,>,431555,A,,,,,GTT
    NSE,100,6,>,431555,A,,,,,GTT
    NSE,22,6,>,431555,A,,,,,GTT

    ,,,,,,,,,,
    ,,,,,,,,,,
    ,,,,,,,,,,
    ,,,,,,,,,,
    ,,,,,,,,,,
    ,,,,,,,,,,
    ,,,,,,,,,,
    ,,,,,Entire row of row 3 & row 4 both will be deleted after runing the macro,,,,

    But you have not made any attempt to look at the macro I gave, or check anything.
    So I am wasting my time helping you further..





    Quote Originally Posted by fixer View Post
    Instead of this
    Code:
    Let PathAndFileName = ThisWorkbook.Path & "\csv Text file Chaos\" & "Alert 24 Mai..csv"
    I need this type of opening of file
    Code:
    Set w2 = Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\2.csv")
    This makes no sense, since you are comparing two different things. I have explained that to you in great detail many times already.

    I think I can probably guess what you are wanting, and I could probably spend a lot of time, as I have done in the past, to give you the solution that you want. But you would probably never read it, or never understand it, or never even try out any macro I give you .
    So I would be wasting my time.




    The biggest problem you have is yourself

    You are trying to go fast by making stressed out quick rubbish posts … because of this you are missing everything, making big mistakes and so going very very slow , often you go backwards , and will never get anywhere, ever…




    Alan
    Last edited by DocAElstein; 06-07-2020 at 09:30 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Delete One Row From A 2D Variant Array
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 18
    Last Post: 02-23-2020, 03:10 PM
  2. Replies: 6
    Last Post: 03-26-2014, 03:04 PM
  3. Replies: 1
    Last Post: 02-25-2014, 10:55 PM
  4. Delte a specific column and does not delete the top row
    By jffryjsphbyn in forum Excel Help
    Replies: 1
    Last Post: 06-13-2013, 02:00 PM
  5. Replies: 4
    Last Post: 03-22-2013, 01:47 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •