bluehope999 发表于 2010-8-19 10:52:47

对excell表格的操作问题

如何在输入框中输入一个代码,如:服装编号,能够在下面几行列出该编号的服装的规格、价格等。
编码、规格、价格这些都在一张excell表格中,处于同一行。
如何实现?请指教,谢谢!

bluehope999 发表于 2010-8-19 11:37:01

自己顶一下,请求帮助

weiyun 发表于 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
页: [1]
查看完整版本: 对excell表格的操作问题