|
本帖最后由 eking_tang 于 2015-6-16 11:26 编辑
逻辑大概想到了,可是代码写不出来,求大神们帮忙了,感谢大家先
- For b = 8 To Cells(Rows.Count, "a").End(3).Row
- If IsError(Range("ax" & b)) Then
- Cells(b, 1) = 0
- Else
- xx = Range("ax" & b)
- j = IIf(Cells(b, "L") <> "", 12, Cells(b, "L").End(xlToRight).Column) '从L列开始找b行第一个非空列
- If Cells(b - 2, j) = "" Then '非空列b-2行为空
- Cells(b, 1) = Cells(b, 1) / xx * 0.041666 + n
- Else '非空列b-2行不为空
- Cells(b, 1) = Cells(b, 1) / xx * 0.041666 + Cells(b - 1, 1)
- End If
- End If
- Next
复制代码
|
|