I'm working in Excel on a VBA project, and want part of my macro to prompt the user to select a range of cells*, which the macro can later do stuff with.
*The type of prompt you get when creating a chart, or using a GUI to insert a function
e.g. here:
and here:
I'm therefor looking for something along the lines of
Sub MyMacro()
MsgBox "Please select data range"
' allow user to select range (as images above)
CreateFunctionArgumentsPrompt()
'do stuff with user selected range of cells
...
End Sub
Is it possible to access built-in Excel functionality to perform what I refer to as: CreateFunctionArgumentsPrompt()
Note: this is similar to SO question excel vba get range of user selected range by mouse but differs in that
This isn't using the built in that you showed above, but does allow you to select a range of cells following an income prompt:
Sub RangeSelectionPrompt()
Dim rng As Range
Set rng = Application.InputBox("Select a range", "Obtain Range Object", Type:=8)
MsgBox "The cells selected were " & rng.Address
End Sub
This is based on the answer given in this MrExcel answer.
Here is how it looks in use: