prompt user to select by mouse

  • Thread starter masoud ebrahimi iran
  • Start date
M

masoud ebrahimi iran

i want creat un specifid reng and import reng argumant by mouse selection

mens that prompt to user to select range

as when select renge in sum function
 
G

Gary''s Student

Consider the following macro in an Excel worksheet:

Sub demonstration()
Dim r As Range
Set r = Application.InputBox(prompt:="Please enter the range", Type:=8)
r.Interior.ColorIndex = 3
End Sub

This will allow the User to either select the range by using the mouse or by
typing in the inputbox.
 
C

Clif McIrvin

Gary''s Student said:
Consider the following macro in an Excel worksheet:

Sub demonstration()
Dim r As Range
Set r = Application.InputBox(prompt:="Please enter the range",
Type:=8)
r.Interior.ColorIndex = 3
End Sub

This will allow the User to either select the range by using the mouse
or by
typing in the inputbox.

Excel 2003 SP3; XP Pro SP3

The above code throws Runtime error 424, "Object Rquired" when I try it.

The input box comes up, I can select cells with the mouse, which causes
the range address to appear in the input box. The error pops when I
click OK. (The locals window shows r as a range containing nothing.)

Any suggestions?
 
C

Clif McIrvin

Clif McIrvin said:
Excel 2003 SP3; XP Pro SP3

The above code throws Runtime error 424, "Object Rquired" when I try
it.

The input box comes up, I can select cells with the mouse, which
causes the range address to appear in the input box. The error pops
when I click OK. (The locals window shows r as a range containing
nothing.)

Any suggestions?


Problem has been resolved... other error in worksheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top