Sentencia IF con MSGBOX

Hola que tal he creado un botón que al hacer clic, realice un sentencia if, y luego imprima un formulario, deseo que cuando haga esa sentencia if, me pregunte si deseo continuar o no, he llegado hasta aquí, pero no logro hacer que al cliquear en SI o NO, imprima o no
Sub Botón54_AlHacerClic()
If Range("AS41") <> 0 Then MsgBox "DISTRIBUCIÓN DE PAYLOAD DIFIERE DE LO MANIFESTADO, Desea Continuar?", vbInformation + vbYesNo, "ATENCIÓN"
Application.ScreenUpdating = False
Sheets("Loadsheet for print").Select
Range("aq10") = Time
ActiveWindow.SelectedSheets.PrintOut Copies:=Range("B1"), Collate:=True
Sheets("LOADSHEET").Select
Application.ScreenUpdating = True
End Sub
Agradecería su ayuda.

1 Respuesta

Respuesta
1
Aquí va el ajuste propuesto:
Sub Botón54_AlHacerClic()
If Range("AS41") <> 0 Then
sino = MsgBox ("DISTRIBUCIÓN DE PAYLOAD DIFIERE DE LO MANIFESTADO, Desea Continuar?", vbInformation + vbYesNo, "ATENCIÓN")
if sino <> vbyes then exit sub    'si no es SI cancela la rutina
Application.ScreenUpdating = False
Sheets("Loadsheet for print").Select
Range("aq10") = Time
ActiveWindow.SelectedSheets.PrintOut Copies:=Range("B1"), Collate:=True
Sheets("LOADSHEET").Select
Application.ScreenUpdating = True
End if

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas