Spreadsheet.MergeTextValues

This function merges the spreadsheet text labels with the text labels of the specified file.

Syntax Parameters Return Value
Sub Spreadsheet.MergeTextValues( _
    Input As Variant, _
    Optional Mode As Variant)
  • Input [in]

The input file. This can be a spreadsheet object or a file path to a saved spreadsheet.

Type: Variant

  • Mode [in,optional]

The merging mode. The available constants for this parameter are: scMergeReplaceText, scMergeConcatatenateText1, scMergeConcatatenateText2. Note that this parameter defaults to scMergeReplaceText.

Type: Variant

This function does not return a value.

SVB Example

Merging spreadsheets by text values:

Option Base 1
Option Explicit
Sub Main
    Dim spr As Spreadsheet
    'opens the spreadsheet adstudy.sta and assigns it to the object spr
    Set spr = Spreadsheets.Open(Path & "\examples\datasets\adstudy.sta")
    spr.Visible = True
    'merges the text values from the active spreadsheet with the spreadsheet-
    'activities.sta
    'scmergereplacetext replaces those labels in spreadsheet 1 (adstudy) with
    'those from spreadsheet 2 (activities)
    spr.MergeTextValues(Path & "\Examples\datasets\activities.sta",scMergeReplaceText)
End Sub