Learn how to watch results of a distant cell in a huge spread sheet. Learn how to watch results of a distant cell in a huge spread sheet. What is Watch Window in Excel? Watch window in excel is used to watch for the changes in the formulas we use while working with a large amount of data and formulas, they are available from the formulas tab in the formula auditing section, when we click on watch window a wizard box appears and it gives us the option to select the cell for which the values we need to be monitored or watched. Open a Watch window by selecting Debug Windows Watch Watch 1, or pressing Ctrl+Alt+W 1. You can open additional Watch windows by selecting windows 2, 3, or 4. In the Watch window, select an empty row, and type variable a. Do the same for b and c. Continue debugging by selecting Debug Step Into or pressing F11 as needed to advance. The all-new Connection Manager in Excel 2016 for Mac. The Connection Properties dialog has been streamlined as well to match Excel for Windows, so that you now only see the properties that apply to your particular data connection. All of your connection properties are in one place and just like Excel for Windows.
-->While you're debugging, you can use Watch windows and QuickWatch to watch variables and expressions. The windows are only available during a debugging session.
Watch windows can display several variables at a time while debugging. The QuickWatch dialog displays a single variable at a time, and must be closed before debugging can continue.
If this is the first time that you've tried to debug code, you may want to read Debugging for absolute beginners and Debugging techniques and tools before going through this article.
Observe variables with a Watch window
You can open more than one Watch window, and observe more than one variable in a Watch window.
For example, to set a watch on the values of a
, b
, and c
in the following code:
Set a breakpoint on the
c = a + b;
line by clicking in the left margin, selecting Debug > Toggle Breakpoint, or pressing F9.Start debugging by selecting the green Start arrow or Debug > Start Debugging, or press F5. Execution pauses at the breakpoint.
Open a Watch window by selecting Debug > Windows > Watch > Watch 1, or pressing Ctrl+Alt+W > 1.
You can open additional Watch windows by selecting windows 2, 3, or 4.
In the Watch window, select an empty row, and type variable
a
. Do the same forb
andc
.Continue debugging by selecting Debug > Step Into or pressing F11 as needed to advance. The variable values in the Watch window change as you iterate through the
for
loop.
Note
For C++ only,
You may need to qualify the context of a variable name, or an expression that uses a variable name. The context is the function, source file, or module where a variable is located. If you have to qualify the context, use the context operator (C++) syntax in the Name in the Watch window.
You can add register names and variable names using $<register name> or @<register name> to the Name in the Watch window. For more information, see Pseudovariables.
Use expressions in a Watch window
You can observe any valid expression recognized by the debugger in a Watch window.
For example, for the code in the preceding section, you can get the average of the three values by entering (a + b + c) / 3
in the Watch window:
The rules for evaluating expressions in the Watch window are generally the same as the rules for evaluating expressions in the code language. If an expression has a syntax error, expect the same compiler error as in the code editor. For example, a typo in the preceding expression produces this error in the Watch window:
A circle with two wavy lines icon may appear in the Watch window. This icon means the debugger doesn't evaluate the expression because of a potential cross-thread dependency. Evaluating the code requires other threads in your app to run temporarily, but since you are in break mode, all threads in your app are usually stopped. Allowing other threads to run temporarily can have unexpected effects on the state of your app, and the debugger may ignore events such as breakpoints and exceptions on those threads.
Search in the Watch window
You can search for keywords in the Name, Value, and Type columns of the Watch window using the search bar above each window. Hit ENTER or select one of the arrows to execute a search. To cancel an ongoing search, select the 'x' icon in the search bar.
Use the left and right arrows (Shift+F3 and F3, respectively) to navigate between found matches.
To make your search more or less thorough, use the Search Deeper dropdown at the top of the Watch window to select how many levels deep you want to search into nested objects.
Pin properties in the Watch window
Note
This feature is supported in .NET Core 3.0 or higher.
You can quickly inspect objects by their properties in the Watch window with the Pinnable Properties tool. To use this tool, hover over a property and select the pin icon that appears or right-click and select the Pin Member as Favorite option in the resulting context menu. This bubbles up that property to the top of the object’s property list, and the property name and value is displayed in the Value column. To unpin a property, select the pin icon again or select the Unpin Member as Favorite option in the context menu.
You can also toggle property names and filter out non-pinned properties when viewing the object’s property list in the Watch window. You can access both options by selecting the buttons in the toolbar above the watch window.
Refresh watch values
A refresh icon (circular arrow) might appear in the Watch window when an expression is evaluated. The refresh icon indicates an error or a value that is out of date.
To refresh the value, select the refresh icon, or press the spacebar. The debugger tries to reevaluate the expression. However, you may not want or be able to reevaluate the expression, depending on why the value wasn't evaluated.
Hover over the refresh icon or see the Value column for the reason the expression wasn't evaluated. Reasons include:
An error occurred as the expression was being evaluated, as in the previous example. A timeout might occur, or a variable might be out of scope.
The expression has a function call that could trigger a side effect in the app. See Expression side effects.
Automatic evaluation of properties and implicit function calls is disabled.
If the refresh icon appears because automatic evaluation of properties and implicit function calls is disabled, you can enable it by selecting Enable property evaluation and other implicit function calls in Tools > Options > Debugging > General.
To demonstrate using the refresh icon:
In Tools > Options > Debugging > General, clear the Enable property evaluation and other implicit function calls check box.
Enter the following code, and in the Watch window, set a watch on the
list.Count
property.Start debugging. The Watch window shows something like the following message:
To refresh the value, select the refresh icon, or press the spacebar. The debugger reevaluates the expression.
Expression side effects
Evaluating some expressions can change the value of a variable, or otherwise affect the state of your app. For example, evaluating the following expression changes the value of var1
:
This code can cause a side effect. Side effects can make debugging more difficult by changing the way your app operates.
An expression with side effects is evaluated only once, when you first enter it. After that, the expression appears grayed out in the Watch window, and further evaluations are disabled. The tooltip or Value column explains that the expression causes a side effect. You can force reevaluation by selecting the refresh icon that appears next to the value.
One way to prevent the side effects designation is to turn off automatic function evaluation. In Tools > Options > Debugging > General, deselect Enable property evaluation and other implicit function calls.
For C# only, when evaluation of properties or implicit function calls is turned off, you can force evaluation by adding the ac format modifier to a variable Name in the Watch window. See Format specifiers in C#.
Use Object IDs in the Watch window (C# and Visual Basic)
Sometimes you want to observe the behavior of a specific object. For example, you might want to track an object referred to by a local variable after that variable has gone out of scope. In C# and Visual Basic, you can create Object IDs for specific instances of reference types, and use them in the Watch window and in breakpoint conditions. The Object ID is generated by the common language runtime (CLR) debugging services and associated with the object.
Note
Object IDs create weak references that don't prevent the object from being garbage collected. They are valid only for the current debugging session.
In the following code, the MakePerson()
method creates a Person
using a local variable:
To find out the name of the Person
in the DoSomething()
method, you can add a reference to the Person
Object ID in the Watch window.
Set a breakpoint in the code after the
Person
object has been created.Start debugging.
When execution pauses at the breakpoint, open the Locals window by choosing Debug > Windows > Locals.
In the Locals window, right-click the
Person
variable and select Make Object ID.You should see a dollar sign ($) plus a number in the Locals window, which is the Object ID.
Add the object ID to the Watch window by right-clicking the Object ID and selecting Add Watch.
Set another breakpoint in the
DoSomething()
method.Continue debugging. When execution pauses in the
DoSomething()
method, the Watch window displays thePerson
object.Note
If you want to see the object's properties, such as
Person.Name
, you must enable property evaluation by selecting Tools > Options > Debugging > General > Enable property evaluation and other implicit function calls.
Dynamic View and the Watch window
Some scripting languages (for example, JavaScript or Python) use dynamic or duck typing, and .NET version 4.0 and later supports objects that are difficult to observe in the normal debugging windows.
The Watch window displays these objects as dynamic objects, which are created from types that implement the IDynamicMetaObjectProvider interface. Dynamic object nodes show the dynamic members of the dynamic objects, but don't allow editing of the member values.
To refresh Dynamic View values, select the refresh icon next to the dynamic object node.
To display only the Dynamic View for an object, add a dynamic format specifier after the dynamic object name in the Watch window:
- For C#:
ObjectName, dynamic
- For Visual Basic:
$dynamic, ObjectName
Note
- The C# debugger doesn't automatically reevaluate the values in the Dynamic View when you step to the next line of code.
- The Visual Basic debugger automatically refreshes expressions added through the Dynamic View.
- Evaluating the members of a Dynamic View can have side effects.
To insert a new watch variable that casts an object to a dynamic object:
- Right-click any child of a Dynamic View.
- Choose Add Watch. The
object.name
becomes((dynamic) object).name
and appears in a new Watch window.
The debugger also adds a Dynamic View child node of the object to the Autos window. To open the Autos window, during debugging, select Debug > Windows > Autos.
Dynamic View also enhances debugging for COM objects. When the debugger gets to a COM object wrapped in System.__ComObject, it adds a Dynamic View node for the object.
Observe a single variable or expression with QuickWatch
You can use QuickWatch to observe a single variable.
For example, for the following code:
To observe the a
variable,
Set a breakpoint on the
a = a + b;
line.Start debugging. Execution pauses at the breakpoint.
Select the variable
a
in the code.Select Debug > QuickWatch, press Shift+F9, or right-click and select QuickWatch.
The QuickWatch dialog appears. The
a
variable is in the Expression box with a Value of 1.To evaluate an expression using the variable, type an expression such as
a + b
in the Expression box, and select Reevaluate.To add the variable or expression from QuickWatch to the Watch window, select Add Watch.
Select Close to close the QuickWatch window. (QuickWatch is a modal dialog, so you can't continue debugging as long as it is open.)
Continue debugging. You can observe the variable in the Watch window.
See also
Often there are some cells in our worksheet where we have important formulas. And, those formulas help us to calculate some crucial values.
In this situation, it’s really important to take an eye on those cells, whether the calculation is correct or there is no error.
But the point is, the more you have this kind of cells the more you need to put your efforts and time to track them.
In Excel, there is an option called watch window which was introduced by Microsoft in 2013 version and, it can be your tool of trade once you know how useful it is.
In this post, you will learn how can you track your important cells with watch window in Excel.
Quick Note: It’s one of those Excel Tricks that can help to get better at Basic Excel Skills. So, let’s get started.
Where to find it on Ribbon?
Go To Formula Tab → Formula Auditing → Watch Window.
You can also use Alt + M + W to open watch window.
Adding a Cell to Watch Window
- Click on Add Watch.
- Add Cell Address to the input box.
- Click OK.
Monitoring Important Cells With Watch Window
We can inspect and audit following components with watch window.
- Workbooks Name: When you add a cell to watch, it will capture the name of the workbook.
- Worksheet Name: Worksheet name will also capture along with the workbook name. When you have a lot of worksheets in your workbook it is easy to identify cell with worksheet name.
- Name: It will also capture the name of the cell range if specified by you.
- Cell Address: It will show the address of the cell.
- Cell Value: You have cell value in the watch window. It is a volatile value which can change when the actual value in the cell will change. It makes easy to audit values in the cell.
- Formula: If added cell has a formula, you will get that in your watch window. This makes it easy to inspect and audit them.
- Select the cell which you want to delete.
- Click on the delete button or press delete.
Watch Window In Excel
To delete more than one cell use shift + arrow key or you can also use shift + end key to select all the cells to delete.
Fix Watch Window Below Your Excel Ribbon
You can also fix it at below your ribbon. To do that just double click on the title bar of watch window.
- You can add as many as cells in it to monitor them but using too many cells will slow down your workbook.
- Double click on the cell entry to select it.
- You can only able to track a cell from a workbook if that workbook is open.
Conclusion
Watch window is a simple solution to one of the biggest issue which people faced who work with dashboards and big data sets.
Where Is The Watch Window In Excel For Mac Free
It helps you to track all of the important cells in a single window. And, the best part is you just have to set up all the cells just for one time and then you track them on real time basis.
Where Is The Watch Window In Excel For Macbook Air
I hope you found it useful and it will help you to save your ton of time and efforts in your work.
Now, tell me one thing. How you track important cells? Share with me in the comment section, I would love to hear from you.
Where Is The Watch Window In Excel For Macbook Pro
And, please don’t forget to share this tip with your friends.
Excel On Mac Vs Pc
Puneet is using Excel since his college days. He helped thousands of people to understand the power of the spreadsheets and learn Microsoft Excel. You can find him online, tweeting about Excel, on a running track, or sometimes hiking up a mountain.