Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Control for Range


"Syed Zeeshan Haider" wrote in
message ...
Hello Experts,
I have Excel 97 Pro on Win98SE.

I guess there is a control available in VBA for Excel (similar to Formula
Palette), which we can use to let the user chose a range for macro. I am
attaching the image (ctl.bmp, 886 bytes) of its typical recognition. My
questions a
What is the name of this control?
How to appear it?

A macro, written by me, needs a range for running but the user has to type
the range in InputBox which is not very wise to me.


If you use the type argument with input box you can select
a range using the mouse

Dim temp_range as Range
Set temp_range = Application.InputBox(prompt:="Select Range for Operation",
Type:=8)

Keith


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Control for Range

"Keith Willshaw" wrote in message ...

If you use the type argument with input box you can select
a range using the mouse

Dim temp_range as Range
Set temp_range = Application.InputBox(prompt:="Select Range for

Operation",
Type:=8)


Thanks! It is a good replacment of RefEdit for certain occasioans.

There is a problem. When I click Cancel button it raises error 424, that is
"Object required".

How can I get rid of this error?

Thank you


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Control for Range

You have to write your code to properly handle the cancel

Dim temp_range as Range
On Error Resume Next
Set temp_range = Application.InputBox(prompt:= _
"Select Range for Operation",Type:=8)
On Error goto 0
if temp_range is nothing then
' user hit cancel
else
temp_range.Select
End if

The last several lines are just illustrative of taking action - you can
program whatever is appropriate in your situation.

--
Regards,
Tom Ogilvy


"Syed Zeeshan Haider" wrote in
message ...
"Keith Willshaw" wrote in message ...

If you use the type argument with input box you can select
a range using the mouse

Dim temp_range as Range
Set temp_range = Application.InputBox(prompt:="Select Range for

Operation",
Type:=8)


Thanks! It is a good replacment of RefEdit for certain occasioans.

There is a problem. When I click Cancel button it raises error 424, that

is
"Object required".

How can I get rid of this error?

Thank you




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Coping Format Control input range to other picklists - HELP!! Tibby Excel Discussion (Misc queries) 0 October 28th 08 04:04 PM
Sum Every 4th column in a range tied to a control cell [email protected] Excel Worksheet Functions 4 August 19th 08 03:41 PM
No range option in format control for combo box Sai Krishna[_2_] Excel Worksheet Functions 1 January 2nd 08 11:37 AM
Is it possible to create a dynamic range in CONTROL TOOLBOX (form) [email protected] Excel Discussion (Misc queries) 7 July 27th 07 07:28 AM
Is it possible to change the Input Range of a Form Control programmatically? dchow Excel Programming 3 November 21st 03 02:10 PM


All times are GMT +1. The time now is 07:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"