|
楼主 |
发表于 2012-1-9 09:02
|
显示全部楼层
adders 发表于 2012-1-7 12:04
写得有点拙,应该可以工作(汇总表的A1:P2这个抬头两行请勿更换,否则需要修改代码)
For Each cel In pzlr.Range("E2:E" & lr)
Select Case cel.Value
Case a
If Not IsEmpty(cel.Offset(, 1)) Then
If IsEmpty(cel.Offset(, -3)) Then
Cells(a1j, "A").Value = cel.Offset(-1, -3).Value
Else
Cells(a1j, "A").Value = cel.Offset(, -3).Value
End If
Cells(a1j, "B").Value = cel.Offset(, 1).Value
a1j = a1j + 1
Else
If IsEmpty(cel.Offset(, -3)) Then
Cells(a1d, "C").Value = cel.Offset(-1, -3).Value
Else
Cells(a1d, "C").Value = cel.Offset(, -3).Value
End If
Cells(a1d, "D").Value = cel.Offset(, 2).Value
a1d = a1d + 1
End If
这个Select Case cel.Value cel是什么意思?
下面也有用到, cel 是什么意思呢?
|
|