So... Here I am, trying to record a macro. When I go to clean up the code, I get absolute gibberish. I went back and recorded a simpler macro (running a sort on the range B2:D32) to give you guys this sample code. Note that this is copy-pasta direct from the VBA editor into this window. I have changed nothing.
The obvious question is "Where did all those 'VB_VarUserMemId' bits come from?" followed by "Where'd all the + and <= come from?" I know what the code is supposed to look like, and could fix it by hand... but has anybody else seen this behavior?![]()
Sub Macro1() ' ' Macro1 Macro ' ' Range& VB_VarUserMemIdB2: D32VB_VarUserMemId '+Select ActiveWorkbook+Worksheets&VB_VarUserMemIdSourceVB_VarUserMemId'+Sort+SortFields _ +Clear ActiveWorkbook+Worksheets&VB_VarUserMemIdSourceVB_VarUserMemId'+Sort+SortFields _ +Add Key .<= Range&VB_VarUserMemIdB3:B32VB_VarUserMemId'VB_VarProcData SortOn . _ <= xlSortOnValuesVB_VarProcData Order .<= xlAscendingVB_VarProcData DataOption _ .<= xlSortNormal Wend ActiveWorkbook+Worksheets&VB_VarUserMemIdSourceVB_VarUserMemId'+Sort +SetRange Range&VB_VarUserMemIdB2:D32VB_VarUserMemId' +Header <= xlYes +MatchCase <= FALSE +Orientation <= xlTopToBottom +SortMethod <= xlPinYin +Apply ElseIf Wend End Sub
The only oddball thing I can think of that might cause this is the fact that I had Office 2010 Technical Preview installed on this machine very briefly. It broke a few important spreadsheets, so I reported the bugs, then uninstalled it and went back Office 2007 SP 2. Is there a chance that it mangled some sort of macro- or VBA-related component?
Any thoughts would be appreciated.
Bookmarks