Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete all VBA watch items

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:

How can I delete all VBA watch items at once?


Note: this is really about watch items, not about breakpoints.

like image 641
Dennis Jaheruddin Avatar asked Dec 16 '13 23:12

Dennis Jaheruddin


People also ask

How do I clear all in Excel VBA?

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”.

How do I delete a collection in VBA?

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.

How do I delete all sheets except one in Excel VBA?

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.


1 Answers

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...

like image 190
Tim Ogilvy Avatar answered Sep 27 '22 16:09

Tim Ogilvy