Within MDUF, a project is a workbook that contains specifications for UserForms, one UserForm per worksheet. Each such worksheet is called a FormSpec worksheet. This section describes procedures for deleting, moving, and replicating FormSpec worksheets within Project workbooks, and among Project workbooks.
- Deleting an MDUF UserForm
- Duplicating an MDUF UserForm
- Annotating UserForms
- Saving a Project as a template
- Deactivating an MDUF FormSpec
- Importing FormSpec worksheets
Deleting an MDUF UserForm
Since an MDUF Project is just a number of FormSpec worksheets in a Project workbook, you can delete an MDUF UserForm from a project by deleting its worksheet from the Project workbook. There is no special command for doing this, and no other action is required. Just delete the FormSpec worksheet as you would any other worksheet.
Duplicating an MDUF UserForm
You can duplicate an MDUF FormSpec worksheet—in MDUF we call it cloning. To clone a FormSpec worksheet into the same workbook as the original, you can use the standard Excel technique for copying any worksheet. But to clone a FormSpec worksheet into a different Project workbook, you use the MDUF Ribbon command MDUF>This FormSpec>This Form>Clone This FormSpec…. MDUF then presents a UserForm titled “Clone This FormSpec”. In that UserForm, you choose the workbook into which you want to insert the clone. Next, you choose the clone’s position in that workbook by selecting the name of the FormSpec before which the clone should be placed.
Cloning is different from copying. If you were to make a copy of a FormSpec worksheet using the standard Excel technique for copying a worksheet from one workbook to another, the copy would contain links back to the original Project workbook. This happens because the internal machinery of a FormSpec worksheet relies on facilities provided by the Project workbook. So simply copying a FormSpec worksheet to another Project workbook creates a copy that relies on the facilities of its original Project workbook.
Cloning, on the other hand, creates a duplicate of the original that relies on the facilities of the target workbook instead of the original, thereby eliminating the introduction of external links back to the original Project workbook.
In cloning, you create a copy of a FormSpec worksheet. The destination can be either the same workbook as the source, or a different workbook. The cool thing about cloning is that any properties of the FormSpec worksheet that are inherited from the source project are then, in the clone, inherited from the destination project. So a FormSpec worksheet that looks like one thing in Project Alpha can look quite different in Project Beta.
You can also clone a Project worksheet, a GNames worksheet, and a SysFont worksheet, but these always go to displace the corresponding sheet in the destination Project workbook.
Annotating UserForms
MDUF provides a means of attaching a note to a UserForm. Annotating UserForms is helpful during development because it provides clear evidence of which version of a UserForm you’re viewing. For example, after you clone a UserForm and make some changes, you might want to inspect the differing versions. Although Excel for Mac doesn’t permit the display of two UserForms simultaneously, when you do display them, it’s helpful to know for sure which UserForm you’re seeing.
What the annotation can contain
The annotation capability is minimal, but it’s sufficient for distinguishing different versions of the same UserForm. You can provide one line of plain text (10-15 characters), or you can let MDUF supply the annotation for you. MDUF places the annotation in the lower right corner of the UserForm.
How to annotate a single UserForm
To produce the default annotation, set the value of the cell UseProductCode to TRUE on the FormSpec worksheet. If you want an annotation other than the default, enter it into the cell ProductCode on the FormSpec worksheet.
The MDUF-supplied annotation is the current date and time in the format of 23-02-21 11:07. (The Excel format directive for this string is “YY-MM-DD HH:MM”.) If you supply text that contains the character “•”, MDUF replace the “•” with the date and time in that format. For example, if you supply “AAA •” as the value of the cell ProductCode, the annotation produced will be “AAA 23-02-21 11:07” if that is the date and time when the form is generated.
How to annotate all UserForms in a project
To annotate all UserForms in an entire project, you have two choices: (a) annotate them all with the same note, or (b) annotate each one uniquely. For (a), to annotate all UserForms identically, clear the cells UseProductCode and ProductCode on the FormSpec worksheet and enter TRUE into the cell UseProductCode on the Project worksheet. If you leave Project!ProductCode blank, MDUF will provide the time/day string described above. Alternatively, you can enter your own annotation string into Project!ProductCode (or a formula that produces what you want) and then MDUF will use that.
For (b), to annotate each of the project’s UserForms uniquely, enter TRUE into the cell captioned UseProductCode on that form’s FormSpec worksheet, and specify the ProductCode as described above—either blank or a string of your own design.
Some gory details
- If Project!UseProductCode is TRUE, setting UseProductCode to FALSE on a FormSpec worksheet inhibits annotation of that sheet’s UserForm.
- If Project!UseProductCode is FALSE, setting UseProductCode to TRUE on a FormSpec worksheet enables annotation of that sheet’s UserForm.
- To have MDUF annotate all UserForms in a project identically, clear the cells UseProductCode and Product code on all FormSpec worksheets, and enter TRUE into the cell Project!UseProductCode. For date and time annotations, clear the cell Project!ProductCode. For another annotation, enter it into Project!ProductCode.
Saving a Project as a template
Since MDUF projects are just Excel workbooks, you can make a project template by saving a Project workbook in Excel template format.
Deactivating an MDUF FormSpec
You can set the status of an MDUF FormSpec to be Active, Testing, or Inactive. Setting status to be Inactive can be useful if you’ve duplicated the FormSpec to make changes and review results. By making the original version Inactive, you can keep it safe for later use or restoration, while you make changes to the new version.
Importing FormSpec worksheets
Using the MDUF ribbon command This Project>Import…, you can import into the active Project workbook the FormSpec worksheets you select from another MDUF Project workbook that you select.
This command enables assembling a collection of FormSpec worksheets from several other projects, which can save effort when a project is meant to be derivative of other projects.