Excel VBA String Functions in Office 365 ~ Work with String Functions!!
Tags: vbamacros, vbastringfunctionsin
Published: 2020-12-18 12:23:17

---
title: Excel VBA String Functions in Office 365 ~ Work with String Functions!!
published: true
date: 2020-12-18 11:58:12 UTC
tags: VBAMacros,VBAStringFunctionsin
canonical_url: https://geekexcel.com/excel-vba-string-functions-office-365/
---

Strings are a **sequence of characters** consist of alphabets, numbers, or special characters. You need to give strings within the double quotes like **“Excel”** or **“a”**. In this short article, we will see how to use **[VBA](https://geekexcel.com/excel-office-365-vba-overview-definition-and-examples/) String Functions in Excel Office 365** with its explanation.

## Basic Syntax:

**Variablename = “string”**

For instance, **str1 = “GeekExcel”** , **str2 = “123”** , **str3=”#$GK”**.

## String Functions in Excel VBA:

[VBA](https://geekexcel.com/excel-office-365-vba-overview-definition-and-examples/) contains a good deal of string functions that can be used to manipulate the strings in Excel. Let’s see the functions and their descriptions one by one.

| **Function** | **Description** |
| --- | --- |
| InStr | This function **returns the position of the first occurrence of the specified substring** in a string. It searches the string from the left to the right. |
| InstrRev | It **returns the position of the first occurrence of the specified substring in a string**. This function will search from the right to the left. |
| Lcase | This function is used to **return the lowercase** of the specified string. |
| Ucase | It will **return the uppercase** of the specified string. |
| [Left](https://geekexcel.com/how-to-use-left-function-in-microsoft-excel-365/) | This function only **returns the specified number of characters** from a text string, starting from the leftmost character. |
| [Right](https://geekexcel.com/how-to-use-right-function-in-microsoft-excel-365/) | It returns a **specified number of characters from a text** string that starts from the rightmost character. |
| [Mid](https://geekexcel.com/how-to-use-mid-function-in-microsoft-excel-365/) | **Returns a substring from a text string** at the position that you specify. |
| Ltrim | It **returns the string after removing the spaces** on the **left** side. |
| Rtrim | This function **returns a string after removing the spaces on the right side** of the specified string. |
| [Trim](https://geekexcel.com/use-trim-function-in-microsoft-excel-2013-simple-methods/) | The trim function **returns a string value after removing both the leading and the trailing blank spaces**. |
| [Len](https://geekexcel.com/how-to-use-len-function-in-microsoft-excel-365/) | Gives the **length** of the given input string. |
| Replace | It returns a string after **replacing a string with another string**. |
| Space | Used to **fill the string with** the specified number of **spaces.** |
| StrComp | This function **returns** an **integer** value after comparing the two specified strings. |
| String | The string function will **return** a **string**  **with a specified character** for a specified number of times. |
| StrReverse | It returns a string after **reversing the sequence of the characters** of the given string. |

## Closure:

In this short article, we described the **VBA String Functions in Excel Office 365** with its descriptions. Drop your **feedback** in the comment section. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!