如何用vba获得excel表中的总行数,或者总列数???
www.dimcax.com
如何用vba获得excel表中的总行数,或者总列数???
我做的程序用vba调用excel中的数据,但是遇到一个问题,不知道如何获得excel表中的总列数,或者总行数
例子如下:
with excelapp.activeworkbook.worksheets("~cs5")
for i = 2 to ?????? step 1
pt1(0) = range("c" & i)
pt1(1) = range("d" & i)
pt1(2) = range("e" & i)
thisdrawing.modelspace.addpoint pt1
next i
end with
??????里面我该怎么填啊??给段代码可以吗???
usedrange
做了个试验:
dim i as integer
dim j as integer
j = 0
for i = 2 to usedrange step 1
j = j + 1
next i
textbox2.text = j
结果返回0,无解哦~~~~~~~问题在哪啊??
for i=2 to sheets("sheet1").usedrange.rows.count