Text to Columns Automation
Split text in cells based on delimiters like commas, spaces, or custom characters
580 views
Perfect For:
- Split names into first/last
- Separate addresses
- Parse CSV data
VBA Code
Sub TextToColumnsAutomation()
Dim ws As Worksheet
Dim dataRange As Range
Dim delimiter As String
Set ws = ActiveSheet
delimiter = InputBox("Enter delimiter (comma, semicolon, space, etc.):", "Delimiter", ",")
If delimiter = "" Then Exit Sub
' Select the range containing text to split
Set dataRange = Application.InputBox("Select range to split:", Type:=8)
' Split the text using the specified delimiter
dataRange.TextToColumns Destination:=dataRange, _
DataType:=xlDelimited, _
Other:=True, _
OtherChar:=delimiter, _
ConsecutiveDelimiter:=False
MsgBox "Text split into columns successfully!"
End Sub
Related Topics
text
split
columns
delimiter
Need Custom VBA Solutions?
Our AI-powered VBA generator can create custom code tailored to your specific requirements in seconds.
Free AI generations every month — top up with credit packs anytime
Related Templates
More VBA templates in the same category
Intermediate
CSV Import with Data Types
Import CSV files with automatic data type detection and formatting
View Template
Beginner
Data Processing & Cleanup
Remove duplicates, clean data formats, and standardise entries
View Template
Intermediate
Timesheet & Attendance Tracker
Track employee working hours, overtime, absences, and holidays with automatic calculations, weekl...
View Template