Copy this excel macro?

I have this code below, and basically I want it to make the whole range of cells from R16before R200and Range("G16").Selectto G200.

i.e. when it changes to R17, then G16 becomes 17, when R18 then G18, etc.

Thus, the entire function works with a change R2on R3and G2on G3, starts again and changes R3to R4, G3on G4, etc.

Sub Search()

Range("H2").Select
ActiveCell.FormulaR1C1 = "=IF(ISNUMBER(SEARCH(R16C6,RC[4])),RC[2],"""")" ' Edit RXX value
Range("H2").Select
Selection.AutoFill Destination:=Range("H2:H385")
Range("H2:H385").Select
Range("G16").Select ' Edit GXX value
ActiveCell.FormulaR1C1 = "=SpecialConcatenate(C[1])"
Range("G11").Select
Application.Run "Test.xlsm!CopyPaste"
Range("H2").Select

End Sub
+3
source share
1 answer
Sub Search2()

    With Range("h2:h385")
        .FormulaR1C1 = "=IF(ISNUMBER(SEARCH(R[14]C6,RC[4])),RC[2],"""")"
    End With

    Range("G16").FormulaR1C1 = "=SpecialConcatenate(C[1])"
    Application.Run "Test.xlsm!CopyPaste"

End Sub

R , , . , R [14] 16, 2, 214, 're 200.

+2

Source: https://habr.com/ru/post/1752688/


All Articles