Excel VBA InputBox Range Select Button

Ok Therefore, I am familiar with InputBoxs in VBA to some extent. I know Type:=8 requirement for range selection. My code works great and allows me to do what I want.

It looks like this: enter image description here

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

enter image description here

I look at various online resources, and the only thing that appears again and again is that Type:=8 needs to be used. MS Help also did not help.

For completeness, 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) 

Does anyone know how to do this? Thanks!

+4
source share
1 answer

You need to create your own form and place the RefEdit control in it .

+3
source

All Articles