I would like to be able to automagically re-sort the worksheets in a given workbook as they appear in the VBE so that they match the order in the GUI.
It seems to me that to do this would require changing the 'codename' of the sheets into ascending numerical order?
1) Can that be done in VBA (as it seems like VBA would need to be modifying 'itself', but not really as long as the code is in a standard module?) and if so, how?
2) Is something 'bad' going to happen if this is run? For example, would inter-sheet forumulae go all wonky due to them using the underlying worksheet.codename rather than the worksheet.name?
NB: I realise that this could cause problems if there were links to the workbook from other sources, but that is no different than changing a worksheet.name in a source workbook if the destination workbook is closed (it won't know, and the links go wrong). I can live with that caveat.