BloquearImpressao
-
Upload
luciano-niespo -
Category
Documents
-
view
214 -
download
0
description
Bloquear impressão
Transcript of BloquearImpressao
-
Pergunta : possvel bloquear uma impresso quando der uma diferena em um determinado range
Resposta : Sim e bem simples, s implementar o evento Workbook_BeforePrint. Veja:
Private Sub Workbook_BeforePrint(Cancel As Boolean) If Range("A1").Value 0 Then msg = MsgBox("Valor de A1 diferente de zero. Deseja realmente imprimir?", vbYesNo) If msg = vbNo Then Cancel = True End If End IfEnd Sub
Cdigo para o vba cancelar ou yes / no
If Range("A1").Value 0 Then msg = MsgBox("Valor de A1 diferente de zero. Deseja realmente imprimir?", vbYesNo) If msg = vbNo Then Cancel = True End If End If