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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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,215,035
Messages
6,122,791
Members
449,095
Latest member
m_smith_solihull

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