Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
check out the inputbox method in vb help
Option Explicit Sub test() Dim result As String result = Application.InputBox("Enter String", "Test", , , , , , 2) If result = False Then MsgBox "cancel pressed" Exit Sub Else MsgBox result End If End Sub -- Gary "Chua" wrote in message ... I use InputBox to display a simple dialog box so that User can enter information to be used in a macro. The dialog box has an OK button and a Cancel button. How do I activate the Cancel button to perform the function that I want? I tried below code but it will do nothing and exit the program even when User click the OK button. a = InputBox ("Enter Password to Proceed:") If vbCancel = True Then Do nothing End If If a < "12345" Then MsgBox "INVALID PASSWORD !!!" & vbNewLine & "You have no administrator rights to access the function.", vbCritical End End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
InputBox: Separate CANCEL and 0 | Excel Programming | |||
How do I capture CANCEL on an Inputbox? | Excel Programming | |||
InputBox - cancel button | Excel Programming | |||
InputBox Function & Cancel | Excel Programming | |||
Clicking Cancel on an Inputbox | Excel Programming |