Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input Box
If I do this:
If Response1 = vbYes Then SaveUserName = InputBox("Enter User Name:") Range("RangeUserName") = "User: " + SaveUserName End If How do I catch if the Cancel button was pressed and therefore don't do anything? Thank you for your help. Steven. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input Box
If Response1 = vbYes Then
SaveUserName = InputBox("Enter User Name:") if saveusername = "" then 'do what you want else Range("RangeUserName") = "User: " & SaveUserName end if End If ps. It's probably a good habit to use & to concatenate text (and + to sum numbers). Steven wrote: If I do this: If Response1 = vbYes Then SaveUserName = InputBox("Enter User Name:") Range("RangeUserName") = "User: " + SaveUserName End If How do I catch if the Cancel button was pressed and therefore don't do anything? Thank you for your help. Steven. -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input Box
If Response1 = vbYes Then
SaveUserName = InputBox("Enter User Name:") if SaveUserName<"" then _ Range("RangeUserName") = "User: " + SaveUserName End If James Steven wrote: If I do this: If Response1 = vbYes Then SaveUserName = InputBox("Enter User Name:") Range("RangeUserName") = "User: " + SaveUserName End If How do I catch if the Cancel button was pressed and therefore don't do anything? Thank you for your help. Steven. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to input pictures automatically based on cell input? | Excel Worksheet Functions | |||
input in number form is being multiplied by 1000 when i input. | Excel Discussion (Misc queries) | |||
Have user input converted to uppercase in same cell as input? | New Users to Excel | |||
How do I add input data in the input ranges in drop down boxes. | Excel Discussion (Misc queries) | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming |