Question : Customize Default Delimiters in Text Wizard?

When you start Excel, the Text Wizard that is used for both importing text files and splitting text into multiple columns starts with only TAB as the default delimiter.  Any change you make during an instance of Excel persists until Excel closes, because the wizard never shuts down (Microsoft Knowledge Base 127132).  However, I would like it to start with TAB and SPACE as default.  Is there any way to set this?  I'd be comfortable defining templates, writing VBA, or editing the Registry, as necessary.

Thanks.

Charlie

Answer : Customize Default Delimiters in Text Wizard?

Hi CharlieL,
The following sub sets the default delimiters by attempting to open a text file which does not need to exist. If this code is working for you, call it from a Workbook_Open sub in a file stored in your xlstart directory.

Sub SetTextWizard()
Application.ScreenUpdating = False
On Error GoTo errhandler
Workbooks.OpenText Filename:="DATA.TXT", _
    DataType:=xlDelimited, Tab:=True, Space:=True
ActiveWorkbook.Close
errhandler: Application.ScreenUpdating = True
End Sub

Cheers!

Brad
Random Solutions  
 
programming4us programming4us