Understanding VBA Code

SKV

Active Member
Joined
Jan 7, 2009
Messages
257
Hi,

I am just an average VBA coder and looking for some advice from the experts in this forum. Basically I am looking for 2 things.

1. Any free application which auto-indents the VBA code
2. Any application then can help understand the loops in the code.......I have written a 300 line code but now having hard time to modifify the logic as I get confused on the existing loops.

Any advise is greatly appreciated.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I'm not an expert, but I may have a tip. While there are debugging features, one simple thing you could do is temporarily code in alerts with bits of information through certain portions of the function of sub you're writing. This will help you confirm what's happening, when, which conditions are being met, and the values of variables and so on. This is especially useful if your code is dependent on interaction from the user.

I'm pretty sure VBA should auto indent. Try: Tools --> Options --> Editor tab: Auto Indent checkbox and tab width input.
 
Upvote 0
Any application then can help understand the loops in the code
This is why documentation within the code is important. You might understand it now, but much later...
 
Upvote 0
hi - can you please elaborate more on " code in alerts" what does it mean? is there an option in VBA to run code in alert? Also I checked your suggestion on auto indent and I see that option but how to activate it as it is checked in machine but it does nothing.
 
Upvote 0
hi - can you please elaborate more on " code in alerts" what does it mean? is there an option in VBA to run code in alert? Also I checked your suggestion on auto indent and I see that option but how to activate it as it is checked in machine but it does nothing.


I'm just saying you can add some lines like this:

Msgbox "Variable123 value is: " & Variable123 & "; Variable234 is: " & Variable 234
 
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,132
Members
451,743
Latest member
matt3388

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