RefEdit - As an input box, not on a user form?

Rusty

Board Regular
Joined
Apr 8, 2002
Messages
108
Question about the refrence edit box / control.

I'm aware that it's available for user forms, but is there the same functionality as just a user box? (eg, like a MsgBox or InputBox) that can be launched from a macro with out the need for a form.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Yes,
see the helpfiles for inputbox
use Type:=8

Code:
Sub test()
Dim RNG As Range

Set RNG = Nothing
  Do
    On Error Resume Next
    Set RNG = Application.InputBox(prompt:="Select your range", _
    Title:="SELECTION", Default:=Selection.Address, Type:=8)
    On Error GoTo 0
    If RNG Is Nothing Then MsgBox "please choose range and press OK", 48, "ERROR"
  Loop While RNG Is Nothing

End Sub

kind regards,
Erik
 

Rusty

Board Regular
Joined
Apr 8, 2002
Messages
108
Thank you so much. :biggrin:

For the code / mini app that I am doing, a user form will be better as I also want to provide an a/b option to determine what to do.

But the knowledge will be very useful in the future.

Thanks again.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,134
Messages
5,835,601
Members
430,369
Latest member
pingel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top