How to Split Column through Excel office VBA? – Easy tricks!!
Tags: tosplitcolumn, vbamacros
Published: 2021-09-18 05:37:00

---
title: How to Split Column through Excel office VBA? – Easy tricks!!
published: true
date: 2021-09-17 03:14:55 UTC
tags: ToSplitColumn,VBAMacros
canonical_url: https://geekexcel.com/how-to-split-column-through-excel-office-vba-easy-tricks/
---

In this tutorial, we will guide you on how to **split columns** through Excel Office VBA. Let’s get them below!! Get an official version of MS Excel from the following link: **[https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)**

## Example

- Firstly, you need to **create a sample data** with **list of names** in the format **FirstName Initial LastName** in column A.

![](https://geekexcel.com/wp-content/uploads/2021/09/Sample-data-16.png)<figcaption>Sample data</figcaption>

- In the Excel Worksheet, you have to go to the  **Developer Tab.**
- Then, you need to ** ** select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://geekexcel.com/wp-content/uploads/2021/09/Select-Visual-Basic-9-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- Now, you have to  **insert a module**.

![Insert a module](https://geekexcel.com/wp-content/uploads/2021/09/Insert-a-module.png)<figcaption>Insert a module</figcaption>

- After that, you need to go to **insert menu** and click on **procedure** , where you will get the **procedure to start the macro**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Procedure-1.png)<figcaption>Procedure</figcaption>

- Now, you have to  **copy and paste the code**  given below.

```
Public Sub SplitName()
    X = Cells(Rows.Count, 1).End(xlUp).Row
        For A = 1 To X
            B = InStr(Cells(A, 1), " ")
            C = InStrRev(Cells(A, 1), " ")
            Cells(A, 2) = Left(Cells(A, 1), B)
            Cells(A, 3) = Mid(Cells(A, 1), B, C - B)
            Cells(A, 4) = Right(Cells(A, 1), Len(Cells(A, 1)) - C)
        Next A
End Sub

```

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

![](https://geekexcel.com/wp-content/uploads/2021/09/Procedure.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- You need to choose the  **Macros option**  in the Code section.

![Choose Macro option](https://geekexcel.com/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Now, you have to make sure that your  **macro name is selected**  and click the  **Run ** button.

![](https://geekexcel.com/wp-content/uploads/2021/09/Run-the-Code-26.png)<figcaption>Run the Code</figcaption>

- Finally, you will receive the  **output ** as **names will split in three columns** in the **Microsoft Excel**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Final-output-5.png)<figcaption>Output</figcaption>

## Conclusion

We hope that this short tutorial gives you guidelines on how to **split columns** through Excel Office VBA. ** ** Please leave a comment in case of any  **queries,**  and don’t forget to mention your valuable  **suggestions**  as well. Thank you so much for Visiting Our Site!! Continue learning on **[Geek Excel](https://geekexcel.com/)!! **Read more on [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!!**

**Continue Reading:**

- **[Excel Formulas to Find the Same Date in Next Year ~ Simple Guide!!](https://geekexcel.com/excel-formulas-to-find-the-same-date-in-next-year/)**
- **[Enter the Date in Excel Sheet ~ Step-by-Step Procedure!!](https://geekexcel.com/enter-the-date-excel/)**
- **[Find the Nth Largest Value in Excel Office 365 ~ Step-By-Step Procedure!!](https://geekexcel.com/find-the-nth-largest-value-in-excel/)**
- **[How to Extract Text Before Nth Specific Character in Excel?](https://geekexcel.com/extract-text-between-nth-specific-character-excel/)**
- **[Excel Formulas to Extract the Time from Date and Time ~ Quick Method!!](https://geekexcel.com/excel-formulas-to-extract-the-time-from-date-and-time/)**