Copy cells between workbooks

前端 未结 3 1957
广开言路
广开言路 2020-12-18 01:45

Could someone please help me with some VBA code.

I am trying to copy 2 ranges of cells between workbooks (both workbooks should be created beforehand as i don\'t wan

3条回答
  •  半阙折子戏
    2020-12-18 01:54

    Assuming you have the reference to wksFrom and wksTo, here is what the code should be

    wksFrom.Range(wksFrom.Range("H5"), wksFrom.Range("H5").End(xlDown)).Copy wksTo.Range("B2")
    wksFrom.Range(wksFrom.Range("K5"), wksFrom.Range("K5").End(xlDown)).Copy wksTo.Range("D2")
    

提交回复
热议问题