• Breaking News

    How to copy range of column and paste - VBA Code

    Copy and paste in the same sheet ( move cursor on the down box)

    Sub Copyandpaste1()

    Dim Lastrow As Long

    Lastrow = Sheets("sheet1").Range("A" & Rows.Count).End(xlUp).Row

    Sheets("sheet1").Range("A2:B" & Lastrow).Copy Destination:=Sheets("Sheet1").Range("H" & Rows.Count).End(xlUp).Offset(1)

    Range("A1").Select

    End Sub

    Copy and paste in another sheet ( move cursor on the down box)

    Sub Copyandpaste2()

    Dim Lastrow As Long

    Lastrow = Sheets("sheet1").Range("A" & Rows.Count).End(xlUp).Row

    Sheets("sheet1").Range("A2:B" & Lastrow).Copy Destination:=Sheets("Sheet2").Range("H" & Rows.Count).End(xlUp).Offset(1)

    Sheets("sheet1").Range("A1").Select

    End Sub




    VBA

    No comments

    View My Stats