Setting selection to Nothing when programming Excel

后端 未结 17 1858
误落风尘
误落风尘 2021-02-02 09:35

When I create a graph after using range.copy and range.paste it leaves the paste range selected, and then when I create a graph a few lines later, it uses the selection as the f

17条回答
  •  不思量自难忘°
    2021-02-02 09:55

    There is a way to SELECT NOTHING that solve your problem.

    1. Create a shape (one rectangle)
    2. Name it in Shapes Database >>> for example: "Ready"
    3. Refer to it MYDOC.Shapes("Ready") and change the visibility to False

    When you want that Excel SELECT NOTHING do it:

    MYDOC.Shapes("Ready").visible=True
    MYDOC.Shapes("Ready").Select
    MYDOC.Shapes("Ready").visible=False
    

    This HIDE the selection and nothing still selected in your window PLUS: The word "Ready" is shown at the Left Top in your Sheet.

提交回复
热议问题