Does .Value = .Value act similar to Evaluate() function in VBA?

前端 未结 4 1664
别跟我提以往
别跟我提以往 2021-01-06 00:33

Consider the following snippet. It writes the same formula to two cells A1 and A2

Sub Main()
    With Range(\"A1\")
        .Formul         


        
4条回答
  •  暖寄归人
    2021-01-06 01:08

    Evaluate is a function And something which use followed by a dot (.) after a function,that is called as property. So ".Value",".Formula",".Text" are properties of Range which you are using here.

    Don't mix up these 2 things.

    A function takes input, perform actions using its input variables and return results. And it works on the data type for which it is configured.

    .value is a generic property which is not dependent on data type. It can be string, numeric, float or whatever.

    so there is possibility where you get error from 1 and other work absolutely fine.

提交回复
热议问题