View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
stevebriz stevebriz is offline
external usenet poster
 
Posts: 195
Default inputbox error when clicking cancel

ADK ,Check this out...
I think this a better solution as it overcomes some known bugs.

http://www.jkp-ads.com/Articles/SelectARange.asp

ADK wrote:
If someone uses this code, but clicks cancle on the inputbox you get a code
error. What cacode can be added to prevent this error?

Sub SelectRange()
Dim UserRange As Range
Set UserRange = Application.InputBox( _
prompt:="Please input or select a range", Type:=8)
UserRange.Font.Bold = True
End Sub