View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default ok cancel dialog box

Sub Test()
Dim v As Object

On Error Resume Next
Set v = Application.InputBox(prompt:="Select a cell for output, or
cancel", Type:=8)
On Error GoTo 0

If Not v Is Nothing Then
MsgBox "User selected range " & v.Address
Else
MsgBox "User cancelled"
End If

End Sub

--
Tim Williams
Palo Alto, CA


"shishi" wrote in message
oups.com...
Hi all,

I am trying to do a simple dialog box. I can't figure out how I can
do this. The user has to select appropriate cell ( by clicking into a
cell) in a work sheet to have the output of a macro go into that cell.
Now I wish to provide a dialog box that has ok and cancel. If the user
is ready for the output, he needs to click and select the appropriate
cell in the sheet and then click ok. If user wants to cancel, he can
click on cancel and the function will not run. I am trying to implement
this..Any ideas..thanks in advance...

shishi