inputbox

emiaj61

New Member
Joined
Dec 11, 2006
Messages
17
al colocar una inputbox para solicitar el ingreso de un dato , si el usuario no escribe nada y presiona aceptar, o presiona cancel sin ingresar ningun dato, o aun si ingresa el dato solicitado pero presiona cancel.
hay manera de pasar directamante al End Sub.
de tal manera que se pare el procedimiento.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
A ver que tal esto:
Code:
Sub PREGUNTAR()
    Dim RESP As Variant

    RESP = Application.InputBox("¿Por qué no escribe algo y no se hace el distraído?")
    If RESP = Empty Then GoTo fin
    MsgBox "Por fin puso un poco de atención y contestó"
    Exit Sub

fin:
    MsgBox "Al final es Ud. un distraído total"
    PREGUNTAR

End Sub
GALILEOGALI
 
Upvote 0
gracias Don Gali, solo agrege despues de la linea : MsgBox " Por fin puso un poco de atencion y contesto"
el codigo a correr si el usuario se anima a escribir algo y clickea enter.
 
Upvote 0

Forum statistics

Threads
1,214,396
Messages
6,119,268
Members
448,881
Latest member
Faxgirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top