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 Egerton Jun 21 '12 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. – eykanal Jun 21 '12 at 13:54
-
2MZ-Tools and SmartIndenter might help, but probably not a lot ( hitechcoach.com/… ) – Fionnuala Jun 21 '12 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. – JimmyPena Jun 21 '12 at 14:25
-
@Remou - Does that work with Office 2007? The site only lists up to '03. – eykanal Jun 21 '12 at 15:19
|
Show 1 more comment
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