microsoft / advanced-formula-environment

Create, edit, and reuse formulas in Excel
https://aka.ms/get-afe
MIT License
109 stars 11 forks source link

There is no option to change the scope of the range #40

Open uahnbu opened 1 year ago

uahnbu commented 1 year ago

Currently we are able to assign a name to a range. However, the default scope for that range is within the workbook, which is the same as changing the name in the native name box. It would be more completed if you add a dropdown list to change the scope of the range, just as in the name manager dialog.

jack-williams commented 1 year ago

Thanks for the suggestion. I've marked this as an enhancement and others can contribute to this thread to provide feedback.

I intentionally left sheet-scoped names out of AFE as it was not designed to be a complete name manager replacement, and sheet-scoping for lambda's was not something I initially wanted to support.

I would be interested to learn more about LAMBDA specific uses that benefit from sheet-scoped names.

stephenjhart commented 1 year ago

I use a hidden worksheet for stuff I don't want end-users to see. Typically I'm doing complicated stuff there, so I use LAMBDAs. Some of these LAMBDAs are also intended for my users, so global scope is suitable for them. But others are addressing under-the-hood complexities I don't want users to be confused by, so I scope them to the hidden worksheet.

Also, this could be a nice place to fix the longstanding difficulty of changing the scope of an existing name.

onderhold commented 8 months ago

I would like to support this feature request as well.

Since names with a worksheet scope are not supported in AFE, these names show up as problems in the grid, although they are perfectly valid: image see image

I define some names within worksheet scope on purpose, since this indicates the source of this range and therefore adds additional meaning to the name.

fladrinar commented 3 months ago

I'll add my request to support worksheet scoped names, please. I just discovered your Excel Labs Add-In and am thrilled. But when I tried to use it to edit a complicated existing function that had worksheet scoped names, it took me a while to figure out what it was complaining about. I often have multiple worksheets with worksheet scoped names. I copy one sheet to a new name for a new project, but keep all together in one workbook. So if the names were scoped at the workbook level, it would be very confusing and not allow me to keep the data sets disjoint without extra renaming work. Maybe it's not as meaningful for lambda functions, but since your editor is so much nicer than the default one I expect to use it for non-lambda function formulas as well.