melodramatic
Board Regular
- Joined
- Apr 28, 2003
- Messages
- 187
- Office Version
- 365
- Platform
- Windows
I've tried looking this up, but can't find a comparable problem with cancelling at an inputbox.
I've got an inputbox that is looking for a text entry, but the odd one out here is that it can left blank at the entry point (if they don't want to filter a list). My problem is trying to get the macro to cancel out if they hit Cancel at this point. I haven't been able to figure out how to make it work.
Here's what I've got (just giving the portion of the macro with the error). Right now, you'll see that I've got the lines commented out, as without them in there, the macro works fine...
I know that it's probably and easy solution, but my brain just won't wrap around that.
Thanks in advance for your help!
I've got an inputbox that is looking for a text entry, but the odd one out here is that it can left blank at the entry point (if they don't want to filter a list). My problem is trying to get the macro to cancel out if they hit Cancel at this point. I haven't been able to figure out how to make it work.
Here's what I've got (just giving the portion of the macro with the error). Right now, you'll see that I've got the lines commented out, as without them in there, the macro works fine...
Code:
'TextFilter for Client Name
Dim ClientFilter As String
ClientFilter = InputBox("Type in text you want to use to filter Client/Contract search:", "Client Name Text Filter")
'If ClientFilter = vbCancel Then
' MsgBox "Macro is cancelled. The current Client Contract selection remains as is."
' Exit Sub
'End If
I know that it's probably and easy solution, but my brain just won't wrap around that.
Thanks in advance for your help!