Get values from other sheet using VBA

后端 未结 7 975
小蘑菇
小蘑菇 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条回答
  •  -上瘾入骨i
    2020-12-09 02:45

    That will be (for you very specific example)

    ActiveWorkbook.worksheets("Sheet2").cells(aRow,aCol).Value=someval
    

    OR

    someVal=ActiveWorkbook.worksheets("Sheet2").cells(aRow,aCol).Value
    

    So get a F1 click and read about Worksheets collection, which contains Worksheet objects, which in turn has a Cells collection, holding Cell objects...

提交回复
热议问题