2

I know that I can use Inputbox to prompt the user to select a range

Set rng = Application.InputBox( _
  Title:="Number Format Rule From Cell", _
  Prompt:="Select a cell to pull in your number format rule", _
  Type:=8)

However when this code is executed, the inputbox will initially be empty

Empty Inputbox

How can I make it so that this box will display the currenty-selected cells?

Freelensia
  • 402
  • 6
  • 18

1 Answers1

2

We can make use of the Default property of the Inputbox method like this:

Set RangeDest = Application.InputBox("Select range to paste onto ", "Obtain Range Object", Selection.Address, Type:=8)

enter image description here

Freelensia
  • 402
  • 6
  • 18