• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Text to column VBA

Abhijeet

Active Member
Hi

I want to Run Text to Column in each Column of excel sheet please tell me how to run this through VBA
 
Hi !

Or, as it depends on data design, use it as well explained in VBA help
(at beginner level) or just activate Macro recorder
before calling it directly from Excel worksheet and well fiil its assistant …
 
Hi Deepak

This macro is run for entire columns how can do check last column run macro till that column please tell me

Code:
Sub text_to_column()
Application.ScreenUpdating = False
On Error Resume Next
For Each wksht In ActiveWorkbook.Worksheets
    For Each col In wksht.Columns
        Columns(col.Column).TextToColumns _
        Destination:=Cells(1, col.Column), _
        DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, _
        ConsecutiveDelimiter:=False, _
        Tab:=True, _
        Semicolon:=False, _
        Comma:=False, _
        Space:=False, _
        Other:=False, _
        FieldInfo:=Array(1, 1), _
        TrailingMinusNumbers:=True
    Next col
Next wksht
Application.ScreenUpdating = True
End Sub
 
Hi
I tried this but how to change in code
Code:
With ActiveSheet
        LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
    End With
 
Back
Top