I have been debugging some macros in Excel VBA, and found it convenient to add a watch when I wanted to monitor some expressions. However, now I want to get a fresh start and decided to start with a clean watch list.
Unfortunately, I have only found a way to delete a single watch, not all of them at once.
Surely there must be a way to get rid of them without having to delete a couple dozen watch items one by one, but despite searching I didn't find any hints of how this can be achieved.
Hence my question:
Note: this is really about watch items, not about breakpoints.
In VBA, there is a method called ClearContents that you can use to clear values and formulas from a cell, range of cells, and the entire worksheet. To use this method, first, you need to define the expression somewhere you want to clear the content, and then type “. ClearContents”.
To remove all items from a collection you can simply set it to nothing. If you set this collection to nothing then it will be set to the state where the “object is not set”. When you add a new item VBA automatically sets the Collection variable to a valid collection.
Click Kutools Plus > Worksheet > Delete All Inactive Sheets. 3. Then a dialog box pops up, if you determine to delete all sheets except active one, click the OK button, otherwise, click the Cancel button. Then all sheets are deleted except the current active one in your workbook.
I couldn't find an easy way to delete them all at once, but if you click on the top item and press the delete key it vanishes without a prompt. Pressing delete 12 times is still reasonably fast...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With