對編輯公式功能的改進 Part 4:名稱
Defined names are a very useful tool for authoring formulas. Defined names allow users to name cell ranges, formulas, and values and refer to those names in their formulas. Used in formulas, defined names make formulas easier to read and more robust. Additionally, when writing formulas, names are less likely to get mis-typed than cell references, and they are easier to remember than cell references (“Tax_Rate” as opposed to “G36”). In this article, I would like to discuss some of the work we’ve done to defined names in Excel 12 – specifically, how we have added new management and creation UI, and how we have added comments to names.
在公式書寫時,名稱是一個很實用的工具。用戶可將單元格引用、公式和常量定義成名稱,并在創(chuàng)建公式時引用它們。應用名稱可使公式變得比較容易理解和維護。此外,相對引用單元格區(qū)域而言,在寫公式的時候使用名稱比較不會出錯,而且方便記憶(例如,用“Tax_Rate(稅率)” 而不用“G36”)。本文討論名稱的改進——重點介紹新增的創(chuàng)建和管理名稱的界面以及如何給名稱添加注釋。
The new Manage Names Dialog
新的名稱管理對話框
Probably the most common piece of feedback we receive about defined names is that the user interface we provide to manage names is inadequate. When we visit customers on site, we often see workbooks with dozens or hundreds and even thousands of defined names, which makes tasks like deleting multiple names, renaming names, and finding broken ones challenging. Enter the new Manage Names dialog, which is designed specifically for viewing and managing the defined names in a workbook.
最常見的關于名稱的抱怨可能是名稱管理界面的缺陷帶來的。我們拜訪客戶時,常會見到客戶的工作簿的名稱達到成百上千之多。在執(zhí)行刪除名稱(多個),重命名和查找錯誤結果值名稱等任務時,這會帶來許多麻煩。新的名稱管理對話框,正是專門設計用來查看和管理工作簿中的名稱的。
The entry point to the Manage Names dialog is in the centre of the new Formulas tab. Here is a shot of the Formulas tab in current builds - you can see a big button titled "Name Manager".
名稱管理對話框功能的按鈕設在新的格式菜單中。目前版本中,只要點擊“格式”標簽,就可以看到一個叫“Name Manager (名稱管理)”的大按鈕。
When you click on the Name Manager button, you will see the Manage Names dialog.
再點擊該按鈕,你會看到一個名稱管理對話框。
Using this dialog, you can:
這個對話框用來:
View existing Defined Names
查看已有的名稱
See the name’s reference (“Refers to” control), the name’s scope (“Scope” Column), and the name’s value (“Value” Column – note, this displays error values as well)
查看名稱的引用范圍(“Refers to” 控件)、適用范圍(“Scope” 欄)和結果值(“Value” 欄——注:錯誤結果值也會顯示出來)
Confirm whether it is referenced in the grid or not (the “In Use” column)
確認該名稱是否已在表格中使用(“In Use”欄)
Create New Names
創(chuàng)建名稱
Easily define the scope of a name in the New Name dialog (dialog discussed below)
在新的名稱框對話框中,可以很容易地指定名稱的適用范圍(在之后的對話框的討論中)
Easily set the name reference
方便地設置名稱引用范圍
Edit existing names
編輯已有的名稱
You can now rename a name without having to redefine it from scratch
名稱可以重命名,不必再為了改名字而重新去定義一個名稱。
You can quickly modify scope from the Edit Name dialog (dialog discussed below)
可以很快地在編輯名稱對話框中修改名稱的適用范圍(在之后的對話框的討論中)
Delete Names quickly
快速刪除名稱
Select and delete multiple names at once
一次性選擇和刪除多個名稱
Sort the Name list
名稱排序
You can sort the name list by clicking on the column headers
單擊欄標題可以對名稱進行排序
Resize the Manage Names dialog
調整名稱對話框的大小
Make the refers-to box as wide as you need, so the number of names you can see is limited only by your monitor size
根據(jù)需要調整refers-to box(引用范圍文本框)的寬度。這樣,名稱的可見程度僅僅取決于桌面窗口的大小
Filter the Name List
名稱篩選
A powerful filter drop down allows you to filter large name lists based on a number of common criteria including scope, in use, and if the name returns an error
強大的過濾器可以遵循幾個常用的規(guī)則來對大量名稱進行篩選。規(guī)則包括適用范圍、是否在用和是否返回錯誤值等。
You can set multiple filters by simply selecting whatever filters they want … for example, you can filter to see all defined names that are not in use an that return errors with two mouse clicks
可以通過簡單的選擇,任意設置多重的過濾器。例如,只需點擊兩次鼠標,就可以篩選出不在使用且返回錯誤值的所有名稱。
One thing we would be interested in hearing is whether hidden names should be surfaced in this dialog. The current design allows users to show hidden names using a control on the filter drop-down, but they are not displayed by default. Our reasoning for this is that customers tell us hidden names cause many problems for users and generate helpdesk issues. At the same time, some solution providers use them as variables with the knowledge that you can't see them in the UI. Our current design would allow savvy users to find the hidden names without writing code. Note, there is a workaround for solution developers, which is to use very hidden names which can be created by using the hidden namespace in XLM (i.e. SET.NAME)
我們假想有用戶需要將隱藏的名稱也顯示在對話框中。目前設計允許通過選擇過濾器上的選項來顯示隱藏名稱,默認設置為不顯示。之所以這么做,是因為用戶反映隱藏名稱會導致許多問題,并希望得到幫助。同時,一些方案提供商使用隱藏名稱作為變量,但它們在用戶界面看不到。目前的設計允許高級用戶不用寫代碼就能查到隱藏名稱。注:對方案開發(fā)者來說,有個變通的辦法——可利用XLM中的隱藏namespace達到真正隱藏名稱的目的。(例如,SET.NAME)