原來如此,現在增加一個判別式就OK了
If Not My Is Nothing And A.Offset(, 28) = "" Then
A.Offset(, 28) = My.Offset(, 1)
End If
If Not My Is Nothing And A.Offset(, 28) <> "" Then
A.Offset(, 29) = (My.Offset(, 1) - A.Offset(, 28)) + My.Offset(, 1)
A.Offset(, 28) = My.Offset(, 1)