Tex to Column VBA Help for 1 Worksheet in Workbook

Hi,

I have the following code which works great for converting text to column in all worksheets within a workbook. I need to edit this code so it works for just 1 worksheet in a very large workbook (my worksheet is call "QueData"). I am a VBA novice. Any suggestions?

Thanks.

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

RE: Text To Columns VBA

Hello,

Remove this

For Each wksht In ActiveWorkbook.Worksheets

and this

Next wksht

lines of code from your subroutine, and change this

For Each col In wksht.Columns

to

For Each col In ActiveSheet.Columns

Select desired sheet on which you want to execute this action and run your macro.

 

Best regards.