text to column code / invalid syntax

V

Vato Loco

I was trying to use this code to automatically delimit cells upo
opening the workbook but it is not working. Can someone tell me what i
going wrong?


Sub auto_open()
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=True, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=True,
Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1)),
TrailingMinusNumbers:=True
End Sub

see example below ... Thanks, Vat
 
F

Frank Kabel

Hi
what exactly does not work?

What is probably missing is the sheet reference. So you may change the
first line to
Activeworkbook.worksheets("sheet1").Columns("A:A").Select
 
Top