View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] madhavansaju@gmail.com is offline
external usenet poster
 
Posts: 2
Default Inputbox to return range from another workbook

hi,

i want the user to open an excel workbook of his choice and then
choose a range from that excel workbook.

this, of course, has to happen during the macro run.
and the macro needs to capture the name of the new workbook, the sheet
name and range chosen.

when using inputbox, it works when i choose a range within the same
workbook as is the macro.
but when i try it with another workbook - nothing is returned.

any ideas?

I am using the code that I found on one of the pages on this very
forum...

Sub tester1()


On Error Resume Next

Set rng = Nothing
Set rng = Application.InputBox("Select a cell with the mouse",
Type:=8)
MsgBox rng.Address
rng.Parent.Activate
If Not rng Is Nothing Then
rng(1).Select
Else
MsgBox "You didn't select"
End If


End Sub


Thanks