Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Coping Format Control input range to other picklists - HELP!! | Excel Discussion (Misc queries) | |||
Sum Every 4th column in a range tied to a control cell | Excel Worksheet Functions | |||
No range option in format control for combo box | Excel Worksheet Functions | |||
Is it possible to create a dynamic range in CONTROL TOOLBOX (form) | Excel Discussion (Misc queries) | |||
Is it possible to change the Input Range of a Form Control programmatically? | Excel Programming |