IAnalysis

Defines the public contract for the Analysis class: worksheet access, row management (add, insert, delete, remove), data exchange (import, export, translate, sort, clean), table validation, and checking/trace access.

Elements

Wksh #

Worksheet hosting the analysis tables

Signature:

Public Property Get Wksh() As Worksheet: End Property

Returns the worksheet bound to this analysis controller during construction.

Returns: Worksheet. The backing analysis worksheet.


RowManagement

AddRows #

Add rows to analysis tables based on the selection header

Signature:

Public Sub AddRows(): End Sub

Add, insert, delete, and remove rows in analysis ListObjects. Reads the header instruction in cell A1 of the analysis worksheet and appends rows to the matching analysis table(s). Delegates to ManageRows internally.


InsertRows #

Insert rows based on a worksheet selection

Signature:

Public Sub InsertRows(ByVal targetCell As Range, _
                      Optional ByVal insertShift As Boolean = True)

Determines which analysis table hosts the selection and mirrors the selection height inside that table. Worksheet row insertion is enabled by default to protect stacked ListObjects.

Parameters:

  • targetCell: Range. Anchor describing the rows to mirror.
  • insertShift: Optional Boolean. When True, worksheet rows are inserted to keep stacked tables aligned. Defaults to True.

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 = True)

Locates the analysis table hosting the selection and removes the intersecting rows, optionally including identifier columns and forcing row shifts.

Parameters:

  • targetCell: Range. Anchor describing the rows to delete.
  • includeIds: Optional Boolean. When True, identifiers are cleared along with data. Defaults to True.
  • forceShift: Optional Boolean. When True, worksheet rows are shifted up after deletion. Defaults to True.

RemoveRows #

Remove rows from analysis tables while preserving required rows

Signature:

Public Sub RemoveRows(): End Sub

Calls the row manager in deletion mode to trim each table down to its required minimum row count.


ManageRows #

Central row-management dispatcher

Signature:

Public Sub ManageRows(Optional ByVal del As Boolean = False): End Sub

Reads the header instruction and adjusts analysis tables accordingly, either by adding or deleting rows depending on the del flag.

Parameters:

  • del: Optional Boolean. When True, rows are removed; otherwise rows are added. Defaults to False.

DataExchange

Import #

Import analysis ListObjects from another worksheet

Signature:

Public Sub Import(ByVal sourchesheet As Worksheet): End Sub

Import, export, translate, sort, clean, and validate operations. Copies each ListObject and its associated headers from the source worksheet into the managed worksheet, preserving cell formatting and validating the result afterward.

Parameters:

  • sourcesheet: Worksheet. The worksheet providing the source analysis tables.

Export #

Export the analysis worksheet to a workbook

Signature:

Public Sub Export(ByVal sourcewb As Workbook, Optional ByVal Hide As Long = xlSheetHidden): End Sub

Duplicates the managed worksheet into the provided workbook so external processes can consume the analysis tables.

Parameters:

  • sourcewb: Workbook. The workbook receiving the exported worksheet.
  • Hide: Optional Long. Excel visibility constant. Defaults to xlSheetHidden.

Translate #

Translate analysis labels using a translation object

Signature:

Public Sub Translate(ByVal translator As ITranslationObject): End Sub

Pushes known textual columns through the translation object so the analysis worksheet reflects the currently selected language.

Parameters:

  • translator: ITranslationObject. The translation engine to use.

Sort #

Sort analysis ListObjects and enforce minimum rows

Signature:

Public Sub Sort(): End Sub

Iterates through the known analysis tables, sorts them with the correct priorities and trims trailing rows so every table meets its structural rules.


Clean #

Clean the analysis worksheet

Signature:

Public Sub Clean(): End Sub

Iterates through all ListObjects on the worksheet and cleans each one via CustomTable.Clean.


EnsureAnalysisTables #

Ensure all expected analysis tables are present

Signature:

Public Sub EnsureAnalysisTables(): End Sub

Validates that every expected ListObject exists on the analysis worksheet. Raises an error or logs a warning for any that are missing.


Checkings

HasCheckings #

Whether trace entries were recorded

Signature:

Public Property Get HasCheckings() As Boolean: End Property

Trace and diagnostic access. Provides a quick way for callers to know if diagnostics are available.

Returns: Boolean. True when at least one trace entry has been logged.


CheckingValues #

Retrieve the collected trace entries

Signature:

Public Property Get CheckingValues() As Object: End Property

Returns the underlying checking object when traces are available.

Returns: Object. The IChecking instance, or Nothing when no traces exist.