[attach]22515[/attach] 作者: cola 时间: 2007-1-8 20:05
你实际上已经用了二次空白的j,它也计了数,所以导致你少二笔数据。作者: cola 时间: 2007-1-8 20:46
Private Sub CommandButton1_Click()
Dim i As Integer
Dim j As Integer
Dim k As Integer
i = 0
k = 0
[M:M].Clear
For j = 0 To [D10] - 1
Cells(1, 13).Offset(P, 0) = Range("B5").Offset(k, i).Value
If Range("B5").Offset(k, i).Value = "" Then
i = 0
k = k + 1
j = j - 1
Else
i = i + 1
End If