Utility to "clean up" VBA code?

chuckles1066

Banned
Joined
Dec 20, 2004
Messages
372
Sorry if this is a stupid question!

I have inherited some spreadsheets with macros but the person who wrote them has left-justified everything.

There are no indentations etc and it's making trying to follow the code really awkward.

Is there something I could use that would indent the bits that would normally be indented?

TIA.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Everybody treats their code differently to some extent, so I'd imagine it would be nigh impossible to get a utility that would be able to decide which way you wanted it.
However, you can Indent in blocks by highlighting a number of lines and pressing the Tab key.
Having said all that I'm sure someone will prove me wrong with the utility.
 
Upvote 0
Hi Peter
Well I'll be darned !!
I never cease to be amazed at what is available !!!!!
 
Upvote 0
greetings M

i will scratch around for some utilities for you to try out. i have a suite of them somewhere in the digital equivalent of the tea-chest in the garden shed
 
Upvote 0
Hi P
Okay....always willing to try and improve the VBA.
 
Upvote 0
Thanks all, especially VoG for the link.

I was working on the premise that there was a "standard and accepted" way of coding macros so that they were easily understood, a "best practice" if you like.
 
Upvote 0
There kinda is !!
You've seen most posters Indenting and commenting and declaring....but person "A"'s "best practice" is sometimes different to person "B"'s
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,337
Members
452,907
Latest member
Roland Deschain

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