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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,521
Members
449,088
Latest member
RandomExceller01

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
Back
Top