Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Prompt user to select a range

I am writing an add-in that loads a form when a certain toolbar item (That I
have created) is pressed. In this form, there is a textbox for a range. I
need to be able to have the user select the range, much like in the Goal Seek
menu, where the range can be hilighted and dynamically updates the content of
the textbox.

My goal is to have the user select a range, and the macro would then perform
a function on that range.

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Prompt user to select a range

Hi Aaron

You could use the refedit control, it should work for what your
after. To use it you will need to add it to your toolbox you can do
this by right clicking the userform toolbox selecting additional
controls and then finding RefEdit.Ctrl and checking it. Then select
the tool and place it on your userform, it works just like the goal
seek selection method.

Hope this helps

Steve

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Prompt user to select a range


Hi Aaron,

The code snippet you can use to do such a thing is:

Private Sub CmdOK_Click()

Dim r As Range
On Error Resume Next
Set r = Range(RefEdit1.Value)
If Err.Number < 0 Then
MsgBox "wrong value for range", vbCritical, "Wrong Range"
End If
On Error GoTo 0
End Sub

Once the range is set, it can be used further in the macro.



"Incidental" wrote:

Hi Aaron

You could use the refedit control, it should work for what your
after. To use it you will need to add it to your toolbox you can do
this by right clicking the userform toolbox selecting additional
controls and then finding RefEdit.Ctrl and checking it. Then select
the tool and place it on your userform, it works just like the goal
seek selection method.

Hope this helps

Steve


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
Prompt user to select a shape MM User Excel Programming 5 August 19th 08 02:05 PM
How to Prompt a user to select a Folder. Akash Excel Programming 3 July 5th 07 05:02 PM
Prompt user to select directory Dan R. Excel Programming 3 March 2nd 07 07:22 PM
Prompt user to select a printer using a checkbox within a user Tom Ogilvy Excel Programming 0 January 10th 07 03:57 AM
how do I prompt the user to select a cell? [email protected] Excel Programming 1 December 19th 06 11:42 PM


All times are GMT +1. The time now is 10:21 PM.

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"