VBA如何强制用户使用Excel内置的范围select来select范围?

我想达到的目的是一旦macros运行,用户必须select(通过手工,而不是通过input范围)一个范围,然后将其设置为一个范围variables。

Excel在很多领域都有这样的function,例如图表的数据select设置,但我不知道如何访问它。 任何和所有的帮助表示赞赏!

下面将强制用户select一个范围:

On Error Resume Next Dim rng As Range Do Set rng = Application.InputBox(Prompt:="Select Range", Type:=8) Loop While rng Is Nothing If Not rng Is Nothing Then rng.Select On Error GoTo 0