Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

Option Explicit

Public rng As Range

Public Sub UserForm_Initialize()
  Me.TextBox1.DropButtonStyle = fmDropButtonStyleReduce
  Me.TextBox1.ShowDropButtonWhen = fmShowDropButtonWhenAlways
  Set rng = Range("A1:B4")
  TextBox1.Value = rng.Address(False, False)
End Sub

Public Sub CommandButton1_Click()
 Unload Me
End Sub

Public Sub TextBox1_DropButtonClick()
    Set rng = Application.InputBox("Select the range", "Range Picker", TextBox1.Text, Type:=8)
    TextBox1.Value = rng.Address(False, False)
End Sub
  • No labels