|
当打印模版中编号有空值时,语句就会出错,请大神指教如何判定为空值时值运行有值数据。
Sub 打印111()
Application.EnableEvents = False
With Sheets("付款明细表")
'If ActiveSheet.ProtectContents = True Then ActiveSheet.Unprotect Password:="1"
If .Cells(Range("L3"), "M") > 0 Then '检查是否打印过
MsgBox "编码" & Range("L3").Text & "和" & Range("L19").Text & Range("L35").Text & "打印过", , "提示"
Else
.Cells(Range("L3"), "M").Offset(1, 0) = 1 'M列记录打印
.Cells(Range("L19"), "M").Offset(1, 0) = 1 'M列记录打印
.Cells(Range("L35"), "M").Offset(1, 0) = 1 'M列记录打印
'ActiveWindow.SelectedSheets.PrintOut From:=1
'ActiveWindow.SelectedSheets.PrintPreview
End If
End With
Application.EnableEvents = True
End Sub
|
|