Excel Macro expert please come ini'm new to macro. is it possible to write a macro which can read data from another excel file?
say macro is in file1.xls, i need to read data from file2.xls
many thanks.
方法很多,说个最简单易懂的
比如说,如果你要把c盘file2里的一个数据表读进file1 spreadsheet1
如果没啥特别的要求,直接用
file1.Cells(i, j).Formula = "='C:\[file1.xls]spreadsheet1'!" & Cells(m, n).Address
(i, j)是file1数据的位置,(m, n)是file2相对应的数据位置
如果没啥特别的要求,直接用
file1.Cells(i, j).Formula = "='C:\[file1.xls]spreadsheet1'!" & Cells(m, n).Address
(i, j)是file1数据的位置,(m, n)是file2相对应的数据位置