Juggler_IN
Active Member
- Joined
- Nov 19, 2014
- Messages
- 358
- Office Version
- 2003 or older
- Platform
- Windows
I have the following code through which I am passing the address of the selected cell to WkRNG variable.
Now, when I click a cell and press okay all goes fine. But, if I press ESC (without any input), I get the runtime 424 error.
Any solution? whereby I can exit the box without runtime error when there is no input.
Now, when I click a cell and press okay all goes fine. But, if I press ESC (without any input), I get the runtime 424 error.
Code:
Dim WkSht As Worksheet, WkRNG As Range, rCell As Range
Set WkSht = ActiveSheet
Range("A1").Select
WkSht.Select
' The user must select the first cell with a value in the column with values for the plot.
Set WkRNG = Application.InputBox(prompt:="Select the cell with the first value (in " & _
"the column with data for the plot):", Type:=8)
' If the user cancelled.
If WkRNG Is Nothing Then Exit Sub
Any solution? whereby I can exit the box without runtime error when there is no input.
Last edited: