找回密码
 加入
搜索
查看: 1709|回复: 2

[AU3基础] 对excell表格的操作问题

[复制链接]
发表于 2010-8-19 10:52:47 | 显示全部楼层 |阅读模式
如何在输入框中输入一个代码,如:服装编号,能够在下面几行列出该编号的服装的规格、价格等。
编码、规格、价格这些都在一张excell表格中,处于同一行。
如何实现?请指教,谢谢!
 楼主| 发表于 2010-8-19 11:37:01 | 显示全部楼层
自己顶一下,请求帮助
发表于 2010-8-19 19:27:02 | 显示全部楼层
给一个代码示例...需要你自己填
#include "Excel.au3"
Func ExcelGetLastCell($oSheet)
        If Not IsObj($oSheet) Then Return SetError(1, 0, 0)
        Return $oSheet.Cells.SpecialCells($xlCellTypeLastCell)
EndFunc   ;==>ExcelGetLastCell

Func GetResultArray()
$oExcel = _ExcelBookOpen(...)
$oSheet = $oExcel.activesheet
$ncolumn = ...
$lastcell = ExcelGetLastCell($oSheet)
For $row = 1 To $lastcell.Row
        If $oSheet.cells($row, $ncolumn) Then
                $array = _ExcelReadArray($oExcel, $row, 1, $lastcell.Column)
        EndIf
Next
EndFunc
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-21 22:39 , Processed in 0.129108 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表