Page 1 of 5 123 ... LastLast
Results 1 to 10 of 49

Thread: Copy and Paste based on comparisons/Match and calculations of cells in two workbooks

  1. #1
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0

    Copy and Paste based on comparisons/Match and calculations of cells in two workbooks

    Moderator notice.
    After going around in circles at a few other forums for a year or two , and despite multi registration duplicating cross posting tricks , the OP , Avinash came here and started again.
    After going around in circles here , 11 months and 3 bans later we are starting again as I write this, … here for example: https://excelfox.com/forum/showthrea...ll=1#post13607

    The total waste of time caused by the OP is arising through an apparent inability, or deliberately trying not to, read or understand anything what so ever of what anyone does for him, with the possible exception of looking for a macro in a post , copying it and possibly running it. If that macro then does not do what he wants ( which he often does not know himself or might change erratically as time goes on ) , he posts any rubbish in a reply , then…
    He will usually , read or understand nothing what so ever of what anyone does for him, with the possible exception of looking for a macro in a post , copying it and possibly running it. If that macro then does not do what he wants ( which he often does not know himself or might change erratically as time goes on ) , he posts any rubbish in a reply , then…
    He will usually , read or understand nothing what so ever of what anyone does for him, with the possible exception of looking for a macro in a post , copying it and possibly running it. If that macro then does not do what he wants ( which he often does not know himself or might change erratically as time goes on ) , he posts any rubbish in a reply , then…

    He will usually , read or understand nothing what so ever of what anyone does for him, with the possible exception of looking for a macro in a post , copying it and possibly running it. If that macro then does not do what he wants ( which he often does not know himself or might change erratically as time goes on ) , he posts any rubbish in a reply , then…

    He will usually , read or understand nothing what so ever of what anyone does for him, with the possible exception of looking for a macro in a post , copying it and possibly running it. If that macro then does not do what he wants ( which he often does not know himself or might change erratically as time goes on ) , he posts any rubbish in a reply , then…

    _... and so on…
    Eventually, whether or not he gets what he wants he will post some canned reply like…“Thx for great help and ur precious time „..,“ problem solved Sir… „

    Then later very likely, here , or somewhere else, or more likely at several places, the whole thing will start again…

    He rarely makes any progress and mostly goes around in circles.
    I am not sure if he does it on purpose or is insane or he just a total dim pig shit for brains. I expect a bit of all of those….

    ( Avinash Singh : https://excelfox.com/forum/showthrea...h-Introduction )





    .... and now he has started again at Eileen's Lounge again, - he came here after getting banned there, now he is starting there again
    https://www.eileenslounge.com/viewto...p?f=30&t=34936
    this guy should be on the stage











    My files name
    target1.xlsx
    target2.xlsx
    macro.xlsm
    If column E of target1.xlsx matches with column A of target2.xlsx then look column O of target1.xlsx is greater or column P of target1.xlsx is greater, whichever is greater calculate the 0.50% of that and multiply that with column K of target1.xlsx and paste the result to target2.xlsx from column C(if column C has data then column D and if column D has data then column E and so on...) the result should be in minus means whatever is the result put minus sign in that along with result
    Last edited by DocAElstein; 07-08-2020 at 10:16 PM.

  2. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,429
    Rep Power
    10
    Hello vixer
    Welcome to EXCELFOX

    I only have time to look quickly at this, so I expect I may not fully get to understand exactly what you want.
    A working example from you is always helpful for such questions, preferably in the form of sample files with a reduced amount of sample data.

    I expect I will not get exactly what you want. But it may be some help. Also, as I do not know your level of VBA understanding , so I am not sure at what level to aim this.

    My offering below is most likely not the best way. In VBA we can usually do such things in a large number of different ways.
    So, in the absence of any more information from you, I will do a way that just amuses me at the moment!

    I like playing with closed workbook references. So in my solution, the only thing that needs to be open is the file
    macro.xlsm

    The other two data files,
    target1.xlsx
    target2.xlsx

    , will need to be stored in the same folder as macro.xlsm

    Finally the file target2.xlsx will be opened to paste in the result.

    I use the second worksheet of macro.xlsm, as a help worksheet. ( In my coding I have the name of that worksheet in a variable , strWsm


    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://eileenslounge.com/viewtopic.php?f=27&t=35521&p=276185#p276185
    https://eileenslounge.com/viewtopic.php?p=276185#p276185
    https://eileenslounge.com/viewtopic.php?p=276185#p276185
    https://eileenslounge.com/viewtopic.php?p=276673#p276673
    https://eileenslounge.com/viewtopic.php?p=276751#p276751
    https://eileenslounge.com/viewtopic.php?p=276754#p276754
    https://eileenslounge.com/viewtopic.php?f=30&t=35100&p=274367#p274367
    https://eileenslounge.com/viewtopic.php?p=274368#p274368
    https://eileenslounge.com/viewtopic.php?p=274370#p274370
    https://eileenslounge.com/viewtopic.php?p=274578#p274578
    https://eileenslounge.com/viewtopic.php?p=274577#p274577
    https://eileenslounge.com/viewtopic.php?p=274474#p274474
    https://eileenslounge.com/viewtopic.php?p=274579#p274579
    https://www.excelfox.com/forum/showthread.php/261-Scrolling-Marquee-text-on-Userform?p=864&viewfull=1#post864
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Attached Files Attached Files
    Last edited by DocAElstein; 04-07-2024 at 11:55 AM.

  3. #3
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0
    i am getting error run time error 9 subscript out of range
    error highlighted line Dim Wsm As Worksheet: Set Wsm = ThisWorkbook.Worksheets.Item(2) ' Second worksheet, (as worksheet object) in this workbook

  4. #4
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0
    Plz see the sample file
    Attached Files Attached Files

  5. #5
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,429
    Rep Power
    10
    Hello Vixer,

    A question for you please
    Attached Images Attached Images
    Last edited by DocAElstein; 08-03-2019 at 02:20 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!!

  6. #6
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0
    i am unable to solve this problem plz have a look and help me sir
    Thnx in advance Sir








    Moderator Translation:
    I am a total fucking idiot dim pig shit for brains, so just give me a macro that does what I want, even though most of the time I aint got a fucking clue myself what I want because I am such a fucking spacko .
    I am not here to waste my time so I aint reading anything you wrote - you are the mug here to waste yout time so just give me the codez
    Last edited by DocAElstein; 06-23-2020 at 01:16 PM.

  7. #7
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0
    Thnx DocAElstein Sir for giving ur precious time and great support to this post but plz provide me the simple vba code that i will attach to my file and i will run the code and it will do the work and file should be automatically selected i dont want the pop up which comes and then i have to select file in short one click and its done so plz have a rellok into this and guide sir





    Moderator Translation:
    I am a total fucking idiot dim pig shit for brains, so just give me a macro that does what I want, even though most of the time I aint got a fucking clue myself what I want because I am such a fucking spacko .
    Last edited by DocAElstein; 06-23-2020 at 01:15 PM.

  8. #8
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,429
    Rep Power
    10
    Hello fixer, ( rider , roger, RangeRover , Leonardo , umpsbug, xyz1234, Pftang Pftang OLE WigWam Biscuit Barrel )


    Quote Originally Posted by fixer View Post
    i am unable to solve this problem plz have a look and help me sir
    ...
    What is the problem?
    I am unable to understand your problem.
    I am unable to understand your question.
    You have not supplied enough information.
    I do not know what you want: You have not shown me what you want.


    Quote Originally Posted by fixer View Post
    plz provide me the simple vba code that i will attach to my file and i will run the code and it will do the work
    What work should it do?
    I am unable to understand your problem.
    I am unable to understand your question.
    You have not supplied enough information.
    I do not know what you want: You have not shown me what you want.


    Quote Originally Posted by fixer View Post
    i dont want the pop up which comes and then i have to select file in short one click and its done
    I do not understand what you are saying.


    Quote Originally Posted by fixer View Post
    so plz have a rellok into this
    I already did this: I told you:
    Quote Originally Posted by DocAElstein View Post
    ..I have looked at your files , ( http://www.excelfox.com/forum/showth...ll=1#post11399 )
    But I do not understand any further what you want.

    I am still unable to understand your problem.
    I am still unable to understand your question.


    I do not think I can help you further because you are unable or unwilling to explain fully what you want.

    Alan
    Last edited by DocAElstein; 08-06-2019 at 12:44 AM.

  9. #9
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0
    Thnx Sir for the support have a great day





    Moderator Translation:
    I am a total fucking idiot dim pig shit for brains, so just give me a macro that does what I want, even though most of the time I aint got a fucking clue myself what I want because I am such a total fucking spacko ... and never mind anyway, fuck off you mug, as some other twat gave me a macro at one of my many duplicated cross postings.......( Intro to Avinash Singh... https://excelfox.com/forum/showthrea...h-Introduction )
    Last edited by DocAElstein; 06-23-2020 at 01:25 PM.

  10. #10
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0

    calculation and multiply by vba

    file name is sample1.xlsx
    vba code will be added to different file
    compare column O is greater or column P is greater
    if column O is greater then calculate the 0.50% of column O and after getting the 0.50% of column O multiply the same with column L and paste the result in column Y
    and if column P is greater then calculate the 0.50% of column P and after getting the 0.50% of column P multiply the same with column L and paste the result in column Y
    save the changes and close the file
    all this i have to do by vba so plz have a look and do needful

Similar Threads

  1. Replies: 85
    Last Post: 06-09-2020, 05:58 PM
  2. Copy paste data based on criteria
    By analyst in forum Excel Help
    Replies: 7
    Last Post: 01-13-2014, 12:46 PM
  3. Replies: 4
    Last Post: 12-12-2013, 06:16 PM
  4. Replies: 8
    Last Post: 10-31-2013, 12:38 AM
  5. Replies: 2
    Last Post: 02-11-2013, 08:13 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
  •