ILLChoices
Defines the public contract for the LLChoices class, exposing management of choice lists used for dropdowns and cascading selectors. Supports adding, removing, sorting, translating, importing, and exporting choices along with their long and short label categories.
Elements
ChoiceData #
Associated DataSheet object
Signature:
Public Property Get ChoiceData() As IDataSheet: End Property
Properties exposing the underlying DataSheet and worksheet. Returns the IDataSheet wrapping the choice worksheet data.
Returns: IDataSheet. The backing DataSheet.
Wksh #
Worksheet hosting the choice lists
Signature:
Public Property Get Wksh() As Worksheet: End Property
Returns the worksheet that stores the choice data.
Returns: Worksheet. The host worksheet.
Choices
Name #
Name of the choice object
Signature:
Public Property Get Name() As String: End Property
Operations for managing individual choice entries. Returns the assigned name, or the worksheet name when none was provided.
Returns: String. The choice object name.
ChoiceExists #
Check whether a choice exists
Signature:
Public Property Get ChoiceExists(ByVal choiceName As String) As Boolean: End Property
Searches the list name column for the specified choice.
Parameters:
choiceName: String. Choice name to search for.
Returns: Boolean. True when the choice is found.
Sort #
Sort choices in the worksheet
Signature:
Public Sub Sort(): End Sub
Sorts by list name ascending, then by ordering column ascending.
AddChoice #
Add a new choice with its categories
Signature:
Public Sub AddChoice(ByVal choiceName As String, _
ByVal longLabelData As BetterArray, _
Optional ByVal shortLabelData As Object = Nothing)
Appends a new choice entry with long labels and optional short labels. Silently exits when the choice already exists or the data is empty.
Parameters:
choiceName: String. Name of the choice to add.longLabelData: BetterArray. Long label values for the categories.shortLabelData: Optional Object. BetterArray of short label values. Defaults to Nothing.
RemoveChoice #
Remove one or multiple choices
Signature:
Public Sub RemoveChoice(ByVal choiceNames As String, Optional ByVal sep As String = ";")
Removes each choice whose name appears in the separator-delimited string. Silently skips choices that do not exist.
Parameters:
choiceNames: String. Choice names separated by sep.sep: Optional String. Delimiter between names. Defaults to ";".
Translate #
Translate the choice worksheet labels
Signature:
Public Sub Translate(ByVal trads As ITranslationObject): End Sub
Applies the supplied TranslationObject to the label and short label columns. Silently exits when headers are invalid.
Parameters:
trads: ITranslationObject. Translation provider.
AddRows #
Add rows to the choice table
Signature:
Public Sub AddRows(): End Sub
InsertRows #
Insert rows at the selected position
Signature:
Public Sub InsertRows(ByVal targetCell As Range, _
Optional ByVal insertShift As Boolean = False)
Mirrors the selection height inside the choices ListObject.
Parameters:
targetCell: Range. Selection anchoring the insertion point.insertShift: Optional Boolean. When True, inserts worksheet rows. Defaults to False.
DeleteRows #
Delete rows intersecting the selection
Signature:
Public Sub DeleteRows(ByVal targetCell As Range, _
Optional ByVal includeIds As Boolean = True, _
Optional ByVal forceShift As Boolean = False)
Parameters:
targetCell: Range. Selection identifying rows to delete.includeIds: Optional Boolean. When True, renumbers the ID column. Defaults to True.forceShift: Optional Boolean. When True, forces worksheet row deletion. Defaults to False.
RemoveRows #
Remove empty rows from the choice table
Signature:
Public Sub RemoveRows(): End Sub
ManageRows #
Add or remove rows via a single toggle
Signature:
Public Sub ManageRows(Optional ByVal del As Boolean = False): End Sub
Parameters:
del: Optional Boolean. When True, removes rows; when False, adds rows. Defaults to False.
AllChoices #
All distinct choice names
Signature:
Public Property Get AllChoices() As BetterArray: End Property
Scans the list name column and returns every unique choice name.
Returns: BetterArray. The distinct choice names.
Categories
Categories #
Categories of a choice
Signature:
Public Property Get Categories( _
ByVal choiceName As String, _
Optional ByVal useShortlabels As Boolean = False) As BetterArray
Category retrieval and formatting helpers. Returns the long label categories for the specified choice. When useShortlabels is True, short labels replace long labels where available.
Parameters:
choiceName: String. The choice to retrieve categories from.useShortlabels: Optional Boolean. When True, uses short labels. Defaults to False.
Returns: BetterArray. The category values.
ConcatenateCategories #
Concatenate all categories of a choice into a string
Signature:
Public Property Get ConcatenateCategories( _
ByVal choiceName As String, _
Optional ByVal sep As String = " | ", _
Optional ByVal trads As Object = Nothing) As String
Joins the categories with a separator. Optionally translates each category via the supplied TranslationObject.
Parameters:
choiceName: String. The choice whose categories to concatenate.sep: Optional String. Separator between categories. Defaults to " | ".trads: Optional Object. A TranslationObject for translation. Defaults to Nothing.
Returns: String. The concatenated categories.
DataExchange
AddHeaders #
Write the default headers to the choice worksheet
Signature:
Public Sub AddHeaders(): End Sub
Import, export, and header initialisation operations.
Export #
Export the choice object to a workbook
Signature:
Public Sub Export(ByVal toWkb As Workbook, Optional ByVal Hide As Long = xlSheetHidden)
Parameters:
toWkb: Workbook. Destination workbook.Hide: Optional Long. Worksheet visibility. Defaults to xlSheetHidden.
Import #
Import choices from a worksheet
Signature:
Public Sub Import(ByVal fromWksh As Worksheet, _
ByVal fromStartRow As Long, _
ByVal fromStartcol As Long, _
Optional ByVal clearSheet As Boolean = False)
Parameters:
fromWksh: Worksheet. Source worksheet.fromStartRow: Long. Start row in the source.fromStartcol: Long. Start column in the source.clearSheet: Optional Boolean. When True, clears the sheet before import. Defaults to False.
ImportChoice #
Import choices from another ILLChoices object
Signature:
Public Sub ImportChoice(ByVal choiObj As ILLChoices): End Sub
Parameters:
choiObj: ILLChoices. Source choice object.
Checkings
HasCheckings #
Whether the choice object has logged diagnostic messages
Signature:
Public Property Get HasCheckings() As Boolean: End Property
Diagnostic logging access. Returns True when at least one diagnostic entry has been recorded.
Returns: Boolean. True when diagnostic entries exist.
CheckingValues #
Retrieve the diagnostic log entries
Signature:
Public Property Get CheckingValues() As Object: End Property
Returns the internal IChecking object containing all logged messages. Returns Nothing when no entries have been recorded.
Returns: Object. An IChecking instance, or Nothing.