Hello Geoff,
Sorry to keep you waiting. I completely rewrote the macros. It should be easier and faster to do your coding now. All the code resides in two modules: a Standard Module and a Class Module. Once you add a new button, you only need to add it to the command button setup list module. The entry lines must be to the left of the button, and the line color must be the yellow that you used, which has a color index of 36. Everything has been added to the attached workbook.
CmdBtnClass Class Module
This customizes the ActiveX (Control Toolbox) added to the workbook to simplify adding lines to the worksheets. After adding a new Class Module to your project, rename it CmdBtnClass.
Setup Command Buttons
After you add a button to a worksheet you will need to add a reference to that button this module. This creates a new custom command button that will automatically add lines when clicked. The row of the first entry line is the row of the upper left corner that the button is in. This first row can be a header row. If it is you need to set the HasHeaderRow property to True. The Default is False. You will see examples of this in the module code.
This macro macro is also called by the Workbook_Open() and Workbook_BeforeSave() events. If for some reason the buttons stop working, run this macro.
Sincerely,
Leith Ross
Bookmarks