How can I copy columns from one sheet to another with VBA in Excel?

前端 未结 5 1784
抹茶落季
抹茶落季 2020-12-09 17:39

I\'m trying to write a macro that copies the content of column 1 from sheet 1 to column 2 on sheet 2. This is how the module looks like but, when I run it, I get

5条回答
  •  一整个雨季
    2020-12-09 18:25

    Selecting is often unnecessary. Try this

    Sub OneCell()
        Sheets("Sheet2").range("B1:B3").value = Sheets("Sheet1").range("A1:A3").value
    End Sub
    

提交回复
热议问题