locked
Excel VBA find paste selection RRS feed

  • Question

  • Hi!

    I am building a macro where i stepping through a list and wants to copy and find the same value in another list.

    The problem is that the "find" function in VBA doesn´t let me use paste. It is referencing the absolute value.

    I also want to automatic loop the macro.

    Sub Makro17()
    '
    ' Makro17 Makro
    '
    ' Kortkommando: Ctrl+x
    '
        ActiveCell.Offset(0, 1).Range("A1").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Tag").Select
        Range("Tabell_Fråga_från_Excel_Files[[#Headers],[Unikt namn]]").Select
        Cells.Find(What:="KO11A16", After:=ActiveCell, LookIn:=xlFormulas, _
            LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
            MatchCase:=False, SearchFormat:=False).Activate
        ActiveCell.Offset(0, 2).Range( _
            "Tabell_Fråga_från_Excel_Files[[#Headers],[Extern address]]").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("Tabell_Fråga_från_Excel_Files[[#Headers],[Unikt namn]]").Select
        Sheets("Data").Select
        ActiveSheet.Paste
        ActiveCell.Offset(0, 1).Range("A1").Select
    End Sub

    Friday, August 19, 2016 8:28 AM

All replies

  • Can you pls give us a description of what you want..

    It seems you have a list. For each item you find related data in another sheet, copy it and paste it on the item itself...


    Best Regards,
    Asadulla Javed, Kolkata
    ---------------------------------------------------------------------------------------------
    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Friday, August 19, 2016 9:08 AM
    Answerer