checking calculation steps in vba modules

Shardey

New Member
Joined
Aug 24, 2022
Messages
28
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
Hi. hope you guys are having a good day. So, i just wanted to know, while running a macro, is it possible to check the code like which data it is picking up, from which sheet, etc. Similar to what we can see in calculation steps on errors in normal excel sheets.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi! That's what compilers are for! Breakpoints are sort of bookmarks where you want to pause the code on the run.
All you have to do is
1.Simply click to the left pane that aligns with the line of code you want to give a break. The line will be highlighted in red.
1670321517047.png

2. Select the variable you want to watch and click right mouse button. Select "Add Wach" in the context menu:
1670321634609.jpeg

3. Enable Watch window from View menu in VBA window. You will see your variable is listed in this window:
1670321809844.jpeg

4.When you run the code, the procedure will stop at the breakpoint and be highlighted in yellow. You can examine the parameters of that object such as Properties, Type, Value, etc.. and even manipulate them on-the-fly:
1670321921156.jpeg


In my example, I would like to see the sheet's name stated in With statement. I hope these steps will help in your future projects.
 
Last edited by a moderator:
Upvote 0
Solution

Forum statistics

Threads
1,214,553
Messages
6,120,176
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top