本帖最后由 mpf5566 于 2014-6-16 11:32 编辑 Global $excel = objCreate("excel.application")
$oexcel.visible = False
with $excel
Dim $kwords[100]=["1","2","3","4"]
$ewb=.workbooks.open(@ScriptDir\txt.xlsx)
$sheets=.worksheets.count
for $i=1 to $sheets
for $w=0 to UBound($kwords)-1
.worksheets($i).cells.find($kwords[$w]).interior.color = 255
local $jishu=.worksheets($i).cells.find($kwords[$w]).activate;查询VBA帮助此语句返回的值可以为TRUE
if $jishu="true" then ;当cells.find能查询到数据$kwords["1","2","3","4"] 元素时计数
$pipeishu=$pipeishu+1
endif
next
next
请问.worksheets($i).cells.find($kwords[$w]).activate 查询出来的结果并不是和数组$kwrods[]匹配!!!得到的$jishu返回值有无怎么样能统计用cells.find语句查询数据$kwords在打开的excel表格中的数量????? |