Get values from other sheet using VBA

后端 未结 7 980
小蘑菇
小蘑菇 2020-12-09 01:55

I want to get values from other sheets.

I have some values in Excel (sheet2) for example:

    A  B  C  D
    -  -  -  -  
1 | 2  5  9  12
2 | 5  8           


        
7条回答
  •  眼角桃花
    2020-12-09 02:38

    Usually I use this code (into a VBA macro) for getting a cell's value from another cell's value from another sheet:

    Range("Y3") = ActiveWorkbook.Worksheets("Reference").Range("X4")

    The cell Y3 is into a sheet that I called it "Calculate" The cell X4 is into a sheet that I called it "Reference" The VBA macro has been run when the "Calculate" in active sheet.

提交回复
热议问题