![]() |
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. |
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 |
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. |
All times are GMT +1. The time now is 10:36 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com