Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
If it there are different meanings to an empty string returned by the user
clicking OK and an empty string returned by the user clicking Cancel, use code like the following: Dim Res As String Res = InputBox("What is the number?") If StrPtr(Res) = 0 Then MsgBox "User Clicked Cancel" ElseIf Res = vbNullString Then MsgBox "User Clicked OK with no input" Else MsgBox "User Entered " & Res End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Corey" wrote in message ... Sub InputNumber() res = InputBox("What is the number?") If res = "" Then Exit Sub End If End Sub "Danny" wrote in message ... Hi, Please edit the macro below so when the user clicks on CANCEL or CLOSE the box, Range A1 existing input won't change. Sub InputNumber() Range("A1").Value = InputBox("What is the number?") End Sub Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to Prevent Duplicate Data from inputing using input application? | Excel Worksheet Functions | |||
How to Prevent Duplicate Data from inputing using input application? | Excel Discussion (Misc queries) | |||
cancel input | Excel Discussion (Misc queries) | |||
input box | Excel Discussion (Misc queries) | |||
Input Form vba help | Excel Discussion (Misc queries) |