Results 1 to 10 of 49

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

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #22
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,522
    Rep Power
    10
    Moderator Notice...
    Here we go again cycle number 3 , slightly different strategy, posting almost the same question in a few cross posts, then juggling around , passing given macros from one place to the other to give the impression of having done something himself.....
    https://chandoo.org/forum/threads/if...9/#post-266341
    https://eileenslounge.com/viewtopic.php?f=30&t=34937
    https://eileenslounge.com/viewtopic.php?f=30&t=34936
    https://www.excelforum.com/excel-pro...o-nothing.html https://excelfox.com/forum/showthrea...ll=1#post13495




    Hi
    I am not sure if I understand exactly what you want.

    If Application.Match does not find a match, then the code line does not error, instead it returns an error string.
    We can use IsError( ) to tell us if an error string has been returned. This will be True if an error string is detected in the ( )

    Possibly you want this

    Code:
         Let MtchRes = Application.Match(arrWs1(Cnt, 9), ClmB(), 0)
            If IsError(MtchRes) Then ' No match was found
             Let arrS1(Cnt, 10) = "delete word"
            Else ' A match was found
                If arrWsA4(MtchRes, 4) = ">" Then
                 Let arrS1(Cnt, 10) = "SHORT"
                ElseIf arrWsA4(MtchRes, 4) = "<" Then
                 Let arrS1(Cnt, 10) = "BUY"
                Else
                End If
                
            End If
    
    If that is not what you want, then provide a file or files to show me what you want

    Alan




    P.S:
    IsError( ) does not tell you if a code line has eroded. If a code line errors, then the macro will stop and you will get an error pop up to tell you about the error.
    Application.Match will return either
    _ a number telling you the position along where it finds in the second argument what you have in the first argument ( Application.Match( First argument , second argument , 0 ) In other words it returns you the position along of the match
    or
    _ an error string if it does not find a match

    Note also:
    WorksheetFunction.Match works a bit differently. If it does not find a match then it will error. I expect your next 50 duplicated cross posted questions will come when a macro you have with that in does not work….
    .... Edit: For example didn't take long... https://eileenslounge.com/viewtopic....271335#p271335
    Last edited by DocAElstein; 07-09-2020 at 10:56 PM. Reason: Didnt take him long to start duplicate cross posting chaos again.https://eileenslounge.com/viewtopic.php?p=271335#p271335

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
  •