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.
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

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.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,084
Messages
5,570,129
Members
412,305
Latest member
Mozz
Top