byronwall/bUTL

Organize the existing code base

byronwall opened this issue · 1 comments

This is the big item that needs to be done. This is inline with the changes made by @RaymondWise and should be applied to all the code files. Items that should be included:

  • All of the modules should have their code sorted alphabetically
  • The worst variable names should be renamed. Ideally, this is standardized at some point.
  • Comments need to be added to all of the code blocks to indicate what they are supposed to do. If there is a way to do this systematically with a tool, that is ideal.
  • Comments should be added to code that is "stranded" or is not associated with a Ribbon button. This code then needs to be added to the Ribbon or all of it placed in a section where it can actually be used.

I will call this closed and let a more specific issue take its place if needed. I went through and added header blocks for all of the modules and Functions/Subs. This should remove most confusion about what things are supposed to do. I am using MZ Tools and Office Automation Smart Indenter to be consistent with sorting, comment blocks, and indentation. There were some comments I saw in there to address from @RaymondWise.

  • ExtendArray is trying to make it easier to extend an array formula down to match the column to the left. This was useful at a previous job where an array formula was used to pull process data from a server. It was much easier than trying to manually do it or trying to use the interface provided by the vendor. It is not a highly valuable feature though.
  • The CombineCell Sub is trying to force a row of cells into a single cell with delimeters. There is a call to Application.Tranpose(Application.Tranpose(..)). This is a cheap trick to convert a 2D array returned by .Value into a 1D array that is a single row.
  • There is a Sub called UpdateScrollbars that forces Excel to refresh the scroll bar boundaries. Sometimes they can get huge after deleting some values. They are updated when you save, but you can also just call UsedRange and it causes Excel to refresh things. Another cheap trick.