

Ordinal = IIf(strOrd = vbNullString, "th", strOrd) _Īre the only numbers ending 1, 2 or 3 where the ordinal is th instead of st, nd or rd. '11, 12, and 13 numbers including one of them e.g., 112, 512 etc. 'Adapted from function posted Microsoft Answers by Paul Edstein.

Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean)įunction Ordinal(lngNum As Long) As String The following illustrates a portion of a content control dropdown list containing the numbers. Let's consider the case where the user is asked to select a number (e.g., day of the month) from a dropdown list and you want the numbered selected to be displayed in ordinal format.Ĭontent control dropdown list members can consist of numbers but the list members themselves can't be a mix of numbers and superscript text.įor example, you can't define 1 st, 2 nd, 3 rd, 4 th, etc. ADCAP Dropdown List Display Calculated Value (Ordinal numbers) Hereafter, I will refer to these "magic" controls as "ADCAP" (or Advanced Capability) content controls. With the addition of some simple VBA in the Document_ContentControlOnExit event, you can make your dropdown list or combo box content controls appear to do "magic" and significantly expand the usefulness of these type controls. That is useful in many cases sure, but what if you need your user to select a listed value but then have the control display a different related value?
