Macro (SVB) Program Examples

Statistica Visual Basic can be utilized to take full advantage of both the Statistica environment and its advanced documents. Numerous example macros are provided in Statistica, online, and in Help to assist you in getting started.


New macro examples are constantly being added to the Statistica Examples file. For access:

Ribbon bar. Select the Home tab. In the File group, click the Open arrow, and select Open Examples to display the Open a Statistica Data File dialog box. Double-click the Macros folder to access the macro examples.

Classic menus. From the File menu, select Open Examples to display the Open a Statistica Data File dialog box. The macro examples are in the Macros folder.


The examples located in the Statistica Examples file can also be found online: Basic Examples


Following are links to SVB (macro) examples included in Help.

Getting Started

A Simple Message Box, and If..Then..End If Block

Spreadsheets and Statistics

Accessing Multiple Modules in a Single Program

Accessing Results Spreadsheet Data

Auto-Fitting a Spreadsheet's Variable Columns

Basic Spreadsheet Manipulation

Converting a Spreadsheet's Data Type

Creating a Cell-Function Spreadsheet

Creating a Custom Spreadsheet

Creating a Random Sized Spreadsheet

Creating a Self-Updating Data Set

Creating Sample Statistics (Descriptives and Correlations)

Customizing a Simple Descriptive Statistics Macro

Formatting Cells in Spreadsheets

Inserting an Array into a Spreadsheet

Resizing a Spreadsheet

Retrieving a Collection of Spreadsheets

Searching a Spreadsheet's Cells for a Value


Accessing and Customizing Graphs

Creating and Customizing Box-Plots

Creating and Customizing Graph Objects

Customizing Graphs

Graph Function Library


Copying Cells from a Spreadsheet into a Report

Customizing Reports


Customizing Workbooks

Inserting All Open Windows into a Workbook

Statistica Query

Creating a Statistica Query Toolbar

Running a Query via a Macro


Adding a Custom Toolbar via a SVB Macro Program

Customizing Toolbars and Menus via Statistica Visual Basic

Displaying a Progress Bar

Launching a New Statistica Application

Opening and Saving Statistica Documents

Printing Statistica Documents

Statistica Dialog for Selecting Data Files

Statistica Dialogs for Selecting Variables

Writing a Custom Statistica Application with User-Defined Dialogs

Other Environments

Accessing Statistica Visual Basic Functions from Microsoft Excel

Accessing Statistica Visual Basic Functions from Microsoft Word