Remove Characters at the Start using Macros (VBA) in Excel 365!!
Tags: removecharactersatth, vbamacros
Published: 2021-02-09 04:37:55

---
title: Remove Characters at the Start using Macros (VBA) in Excel 365!!
published: true
date: 2021-02-09 03:57:34 UTC
tags: Removecharactersatth,VBAMacros
canonical_url: https://geekexcel.com/remove-characters-at-the-start-using-macros-vba-in-excel-365/
---

To remove characters at the start of the input values, you can use [**VBA**](https://geekexcel.com/excel-office-365-vba-overview-definition-and-examples/) & **Macros ** in Excel Office 365. With the help of Macros, you can easily achieve this task. In this article, we are going to learn the steps to **remove characters at the start using Macros (VBA) in Excel Office 365**.
## Steps to Remove Characters at the Start using Macros:

Follow the below instructions to delete characters at the start of the input values in the Excel worksheet.

- In the following image, you can see the input range from cell **B2:B6**. We are going to remove the first two characters of these input values.

![Input range](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_0wzkDRb53c.png)<figcaption id="caption-attachment-21746">Input range</figcaption>

- On the **Developer Tab, select** the **Visual Basic** option under the **Code** section.

![Select Visual Basic option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Select-Visual-Basic-option-5.png)<figcaption id="caption-attachment-14839">Select the Visual Basic option</figcaption>

- Then you need to copy and paste the code given below.

VBA code to remove characters using Macros

Sub RemoveCharactersAtTheStart()

Dim range As Range

Dim num As Integer

‘Get the characters

num = InputBox(“Input the number of characters to remove at the start”, “Num of characters”)

For Each range In Selection

‘Use Right to remove the first x characters

range = Right(range, Len(range) – num)

Next range

End Sub

- You need to **save the code** by selecting it. Then **close** the **window.**

![Save the code](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_CIyJR2TnKg.png)<figcaption id="caption-attachment-21747">Save the code</figcaption>

- You have to open the sheet containing the data. On the **Developer Tab, choose** the **Macros option** in the **Code** section.

![Choose the Macros option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Choose-the-Macros-option-2.png)<figcaption id="caption-attachment-14747">Choose the Macros option</figcaption>

- You need to make sure that your macro is selected and **click** the **Run** button.

![Click Run button](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_W5Q4U7ZoPQ.png)<figcaption id="caption-attachment-21748">Click Run button</figcaption>

- Now, it will display a dialog box, where you want to enter the number of characters that you want to remove from the input range.

![Click the OK button](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_dZO8ZHtu6q.png)<figcaption id="caption-attachment-21749">Click the OK button</figcaption>

- As a result, you will see that the first two characters are removed from the input values as shown in the below screenshot.

![Output](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_kCnVgZNFB0.png)<figcaption id="caption-attachment-21750">Output</figcaption>

## Verdict:

In the above article, we have learned the clear-cut steps to **remove characters at the start using Macros (VBA) in Excel Office 365**. Give your **worthwhile**  **feedback** in the below comment section. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!

### Keep Reading:

- [Add a Degree Symbol to Selection Range using Macros (VBA) in Excel!](https://geekexcel.com/add-a-degree-symbol-to-selection-range-using-macros-vba-in-excel/)
- [Reverse Text Function using Macros (VBA) in Excel Office 365!!](https://geekexcel.com/reverse-text-function-using-macros-vba-in-excel-office-365/)