Named Range Format Options

Posted by: lambchop4697 on 8 September 2017, 2:37 pm EST

  • Posted 8 September 2017, 2:37 pm EST

    I need to create a named range by using one of the following formats ... I do not care which ...

    1)  [[alpha]]

    2)  {{alpha}}

    3)  ||alpha||

    Is there a way to do this within the spread?  I can always strip these out before saving to an Excel spreadsheet, so I am really only needing this functionality for the spread itself.  Any help will be GREATLY appreciated!

    Thank You

    -Eric

  • Replied 8 September 2017, 2:37 pm EST

    Hello,

    In order to define a custom name than represents a cell or range, you can use AddCustomName method but the name of the expression to be added which is to be used in formula can not contain braces because a custom name can contain up to 255 characters and can include letters, numbers, or underscores. The first character must be a letter or an underscore only and not the braces.


    fpSpread1.Sheets[0].AddCustomName("alpha", "$B$3:$D$6", 0, 0); 
    You can refer to AddCustomName method in the product documentation for the same.Thanks.
  • Replied 8 September 2017, 2:37 pm EST

    Reeva-

    Sorry I was not more clear, I know how to add a custom name, but I need to know how to add a custom name that INCLUDES some type of braces (e.g. [ or { or | ).  In this case, I have tried several variations where I put a letter in front of a brace (e.g. L[alpha]) and it still does not work.  So after several tests, I am guessing that this is not possible and that I can ONLY include letters, numbers, or underscores?  Please clarify for me when you get the chance, as this has a big impact on the work I am doing right now.

    Many Thanks!

    -Eric

  • Replied 8 September 2017, 2:37 pm EST

    Hi Eric,

    Welcome to the forum!

    The characters '|, '[', and ']' are not valid for custom names or formulas in Spread or in Excel.  The '{' and '}' characters are used for specifying an array of values.  For example, the formula "=IF(ROWS({1;2;3})=3,1,0)" evaluates to 1 since the specified array has 3 items delimited with ';' and the formula "=IF(COLUMNS({1,2,3})=3,1,0)" also evaluates to 1 since the specified array has 3 items delimited with ','' (this works like in Excel).

     

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels