Results 1 to 10 of 75

Thread: vba Copy Paste Conditional to put remark 1 2 3 .. etc

Threaded View

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

    You may possibly have uploaded the wrong sample pic?
    The sample pic does not explain anything…





    I think you are having difficulty yourself understanding what you want. I do not think you understand anything about what is going on.
    Or
    You are almost completely unable to explain anything correctly in English.




    This is what Molly’s macro does :-

    The conditions which are met are in current macro ( http://www.excelfox.com/forum/showth...ll=1#post12850 ) are these… …

    For each row – the two condition is met scenarios….

    If column I is SELL then see the value of column K & if column K is less than or equal to column E in sheet 2 then put the remark in sheet3

    If column I is BUY then see the value of column K & if column K is greater than or equal t column F in sheet 2 then put the remark in sheet3

    The remark will be in series like 1,2,3,4,5,6 …… and so on. So the remark in column B will always be 1. The remark in column C will always be 2 … and so on


    Currently, if the condition is not met then Nothing is done

    Code:
          Case "SELL" 'If column I is sell
            If arrS1(cnt, 11) > arrS2(cnt, 5) Then ' if column K is Greater than sheet2 of column E then
            ' do nothing - Nothing is done - column K is Greater than column E of sheet2
            Else
            
    Code:
          Case "BUY"  'If column I is buy
           If arrS1(cnt, 11) < arrS2(cnt, 6) Then  ' if column K is lower than sheet2 of column F then
           ' do nothing -  Nothing is done - column K is lower than  column F of sheet2
           Else




    We can only make guesses at what you might want…
    ‘ Condition not met ... clear the data from column B till the end of the data in that entire row


    Code:
         Select Case arrS1(cnt, 9) ' column I
          
          Case "SELL" 'If column I is  SELL
            If arrS1(cnt, 11) > arrS2(cnt, 5) Then ' if column K is Greater than column E of sheet2 Then
            ' Condition not met ... clear the data from column B till the end of the data in that entire row
             Ws3.Range("B" & cnt & ":B" & CL(Lc) & "").ClearContents
            Else
            ' Condition is met
            Let arrS3(cnt)(1, UBound(arrS3(cnt), 2)) = UBound(arrS3(cnt), 2) - 1 ' Put in a value in last array "column"
            End If
          
          Case "BUY"  'If column I is  BUY
           If arrS1(cnt, 11) < arrS2(cnt, 6) Then  ' if column K is lower than column F of sheet2 Then
           ' Condition is not met ....clear the data from column B till the end of the data in that entire row
            Ws3.Range("B" & cnt & ":B" & CL(Lc) & "").ClearContents
           Else
           ' Condition is met
            Let arrS3(cnt)(1, UBound(arrS3(cnt), 2)) = UBound(arrS3(cnt), 2) - 1 ' Put in a value in last array "column"
           End If
         End Select
    ' Edit: see corrrection post #16 below : http://www.excelfox.com/forum/showth...ll=1#post12858 
          




    The biggest problem remains that you cannot explain anything correctly in English. The biggest problem is not Excel or Excel VBA. The biggest problem is the communication difficulty between us

    Have you tried this ?
    https://translate.google.de/?hl=de#v...te&sl=mr&tl=en
    https://translate.google.de/?hl=de#v...%20language%3F



    Alan
    Last edited by DocAElstein; 03-21-2020 at 03:49 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. Replies: 26
    Last Post: 09-26-2020, 05:56 PM
  2. VBA -- Copy/Paste across sheets
    By Rasm in forum Excel Help
    Replies: 4
    Last Post: 09-21-2012, 02:07 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
  •