恳请高手帮忙 vb读Excel表 急!
我要在Form_load实践中,读一个4行4列的Excel表,并把所读的数据放到数组中,请问这该怎么办啊?请求大家帮忙,先谢谢了!
[解决办法]
还是以你前面的贴子为例:
dim r as integer, c as integer
dim cellStr(3,3) as string
dim r0 as integer,c0 as integer
Dim Xl As Object
Dim K As New Excel.Application
Set Xl = K.Workbooks.Open( "C:\123.XLS ")
r0=5 '起始行,自行设定
c0=5 '起始列,自行设定
for r=0 to 3
for c=0 to 3
cellstr(r,c) = Xl.Worksheets(1).Cells(r+r0, c+c0).Value
next c
next r