Excel is quite robust, meaning there is a lot of different tools that can be utilized within it, and therefore there are many skills Excel Resources Excel Shortcuts - List of the most important & common MS Excel shortcuts for PC & Mac users, finance, accounting professions. Keyboard shortcuts speed up your modeling skills and save time.
This Excel tutorial explains how to use the Excel SPLIT function with syntax and examples.
Description
The Microsoft Excel SPLIT function will split a string into substrings based on a delimiter. The result is returned as an array of substrings.
The SPLIT function is a built-in function in Excel that is categorized as a String/Text Function. It can be used as a VBA function (VBA) in Excel. As a VBA function, you can use this function in macro code that is entered through the Microsoft Visual Basic Editor.
Syntax
The syntax for the SPLIT function in Microsoft Excel is:
Parameters or Arguments
Optional. This is the type of comparison to perform when parsing the substrings and can be one of the following:
VBA Constant | Value | Explanation |
---|---|---|
CompareMethod.Binary | 0 | Binary comparison |
CompareMethod.Text | 1 | Textual comparison |
Returns
The SPLIT function returns an array of string values.
Applies To
- Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000
Example (as VBA Function)
The SPLIT function can only be used in VBA code in Microsoft Excel.
Let's look at some Excel SPLIT function examples and explore how to use the SPLIT function in Excel VBA code:
For example:
In this example, the variable called LArray would now contain the array {'TechOnTheNet', 'com'}. The two MsgBox statements would display the value stored in each element of the array.
TIP: When the result is split into an array, the array must be a STRING type array rather than a VARIANT type array.