我是用这找出最后一个非空行的: Sub Macro1() '找出最后一行的非空白行 Dim row_last As Integer Selection.SpecialCells(xlCellTypeLastCell).Select flag = False Do While flag = False If ActiveCell.Row = 1 Then Exit Do End If Selection.End(xlToLeft).Select temp1 = IsEmpty(ActiveCell.Value) Selection.End(xlToRight).Select temp2 = IsEmpty(ActiveCell.Value) If temp1 = True And temp2 = True Then Selection.Offset(-1, 0).Select Else flag = True Exit Do End If Loop Selection.End(xlToLeft).Select row_last = ActiveCell.Row End Sub