Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Prompt user to select a shape | Excel Programming | |||
How to Prompt a user to select a Folder. | Excel Programming | |||
Prompt user to select directory | Excel Programming | |||
Prompt user to select a printer using a checkbox within a user | Excel Programming | |||
how do I prompt the user to select a cell? | Excel Programming |