How to convert Evaluate() to a string without truncation?

后端 未结 1 1185
清酒与你
清酒与你 2021-01-23 22:45

The following code...

Dim Formula As String  
Dim Output As String  

Formula = "IF(ISBLANK(VLOOKUP(D3, SCALES!N:P, 2, FALSE)), CONCATENATE(""PY &q         


        
1条回答
  •  有刺的猬
    2021-01-23 23:45

    The fact is that you've run up against a limitation in Excel--the Evaluate method only takes strings up to 255 characters. You have a few options:

    1. Try removing all unnecessary spaces and use the & instead of the concatenate function. That might shorten your formula enough.
    2. Break the formula up into pieces and use the WorksheetFunction method rather than the Evaluate method.
    3. Put the formula into a cell on your worksheet, calculate it and retrieve the value.

    0 讨论(0)
提交回复
热议问题