Reputation: 3337
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:
However, I want to generate the same type of inputbox that Exel itself generates when selecting a range.
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!
Upvotes: 4
Views: 2857
Reputation: 78210
You have to create your own form and put the RefEdit
control on it.
Upvotes: 3