text to column code / invalid syntax

  • Thread starter Thread starter Vato Loco
  • Start date Start date
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top