作者:乔山办公网日期:
返回目录:excel表格制作
sub m
if sheet1.cells(3,1)="" or sheet1.cells(3,1)=0 then‘通过If进行条件判断,zhidao如果A3=“”或者0
sheet2.printout ’上述条件成立,内执行sheet2表的打印容
else '如果上述条件不成立,即A3不为0时
sheet2.printout ‘则打印工作表sheet2
sheet3.printout ’以及工作表sheet3
end if ‘条件结束
end sub
经测百试,度下面问的答代码可内用容
Dim i As Long
i = 3
Do
If Cells(i, 5).Value <> Cells(i - 1, 5).Value And Cells(i, 5).Value <> 0 Then
Rows(i).Insert shift:=xlDown
i = i + 1
End If
If Cells(i, 5) = 0 And i > Sheet1.UsedRange.Rows.Count Then Exit Do
i = i + 1
Loop
if range("C10") < 0 and range("B36") =2 then
range("C4") = 2
end if