Text to Columns Automation
Split text in cells based on delimiters like commas, spaces, or custom characters
596 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
Timesheet & Attendance Tracker
Track employee working hours, overtime, absences, and holidays with automatic calculations, weekl...
View Template
Advanced
Inventory Management System
Manage stock levels with automatic reorder alerts, stock movement logging, valuation reports, and...
View Template
Intermediate
Data Entry Form with Validation
Professional UserForm-based data entry system with field validation, dropdown lists, date pickers...
View Template