4

Ok. So I'm familiar with InputBoxs in VBA to some degree. I'm aware of the Type:=8 requirement to select a range. My code works fine and allows me to do what I want to.

This is what it looks like: enter image description here

However, I want to generate the same type of inputbox that Exel itself generates when selecting a range.

enter image description here

I've been searching through various online resources and the only thing that comes up again and again is that Type:=8 needs to be used. The MS Help has also not been of much help.

For completness' sake here is my code:

Dim SelRng1 As Range
Dim SelRng2 As Range

Set SelRng1 = Application.InputBox(Prompt:="Please select the first table (headers included)", Title:="Select Table 1", Type:=8)
Set SelRng2 = Application.InputBox(Prompt:="Please select the second table (headers included)", Title:="Select Table 1", Type:=8)

Anyone know how to do this? Thanks!

1 Answer 1

3

You have to create your own form and put the RefEdit control on it.

Sign up to request clarification or add additional context in comments.

1 Comment

Of course, the RefEdit is flaky as anything. I've written an article about using InputBox as an Alternative to Excel's Flaky RefEdit Control. It's not as "nice", but it doesn't crash on 5% of users' machines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.