Results 1 to 10 of 75

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    The next version.....
    Code:
    Sub test() '  https://www.excelforum.com/excel-programming-vba-macros/1321581-put-data-in-series-by-vba.html#post5363303
        Dim r As Range, x, BK As String, myVal
        BK = "'" & ThisWorkbook.Path & "\[1(sample).xls]1-Sheet1'!"
        With Sheets("sheet1")
            For Each r In .Range("b2", .Range("b" & Rows.Count).End(xlUp))
                myVal = r.Value
                If Not IsNumeric(myVal) Then myVal = Chr(34) & myVal & Chr(34)
                x = ExecuteExcel4Macro("match(" & r.Value & "," & BK & "r1c9:r10000c9,0)")
                If IsNumeric(x) Then
                    With .Cells(r.Row, Columns.Count).End(xlToLeft)
                        .Cells(1, 2) = .Value + 1
                    End With
                End If
            Next
        End With
    End Sub
    _... to be looked at later
    ( Note Yasser found it intersting ... https://eileenslounge.com/viewtopic.php?f=30&t=34952 )





    Share '1(sample) excelforum 11july.xls' : https://app.box.com/s/q44t3dglvoq59ozvyi4c411ekw0aox9s
    Share 'H2(SAMPLE) excelforum 11July.xlsb' : https://app.box.com/s/ziudkeb2bdmdosxhcrcx6g243sjn7n7x
    Last edited by DocAElstein; 07-13-2020 at 06:01 PM. Reason: The next version...
    ….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
  •