#include <Excel.au3> $excel = _ExcelBookAttach("Book1.xlsx" ,"FileName") Dim $i = 1 ;_ExcelReadCell($excel,"b"&$i) <>"" 并不等于 not(_ExcelReadCell($excel,"b"&$i) ==""),使用的时候尽量使用后者 While IsInt(_ExcelReadCell($excel,"b"&$i)) $ten = _ExcelReadCell($excel,"b"&$i) if $ten == 0 Then _ExcelWriteCell($excel, $ten, "d"&$i) ElseIf $ten == 1 Then _ExcelWriteCell($excel, $ten, "e"&$i) Else _ExcelWriteCell($excel, $ten, "f"&$i) EndIf $i += 1 WEnd