Is there an equivalent way of achieving what HTML Tidy does to HTML code for VBA code? I just inherited a rats nest of Excel VBA, and I was hoping to just make it easier to read before diving in. I don't mind if I have to export it first; I'm already using VBA Code Cleaner to make the thing work well with Git. Any suggestions?
6
-
1I find the best way to clean up VBA is to delete the spreadsheet ;-)– Jon EgertonJun 21, 2012 at 13:17
-
1@JonEgerton - Heh, we call that the "backup plan". At this point, I'm not sure which would take more time... figuring out this buggy mess or writing my own buggy mess.– eykanalJun 21, 2012 at 13:54
-
2MZ-Tools and SmartIndenter might help, but probably not a lot ( hitechcoach.com/… )– FionnualaJun 21, 2012 at 13:59
-
+1 @Remou for Smart Indenter, makes things much neater. You could also tokenize each VB module into an array to do things like remove empty lines.– JimmyPenaJun 21, 2012 at 14:25
-
@Remou - Does that work with Office 2007? The site only lists up to '03.– eykanalJun 21, 2012 at 15:19
|
Show 1 more comment
1 Answer
There is a utility that will (try) to clean up code: Smart Indenter v3.5
After testing, I can confirm it works in Office 2007 and Office 2010 - it appears in the context menu when you right click on code