ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Recognize pipes "|" in when opening a delimited file in Excel (https://www.excelbanter.com/excel-discussion-misc-queries/21176-recognize-pipes-%22%7C%22-when-opening-delimited-file-excel.html)

Caleb

Recognize pipes "|" in when opening a delimited file in Excel
 
Automatically open delimited files without having the 3-step input box and
include pipes "|" in the delimiting characters.

Jason Morin

I recorded a macro, tweaked the code a little, and used
the workbook_open event:

Sub Workbook_Open()
Dim sPath As String
Dim sFile As String
sPath = "C:\Documents and Settings\jmorin\Desktop\"
sFile = "test.txt"
Workbooks.OpenText Filename:= _
sPath & sFile, _
Origin:=437, _
StartRow:=1, _
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, _
Tab:=False, _
Semicolon:=False, _
Comma:=False, _
Space:=False, _
Other:=True, _
OtherChar:="|"
End Sub

---
Change sPath and sFile to your actual path and file. To
use this macro, save it in ThisWorkbook module (Press
ALT+F11). Save the file and close. Re-open.

HTH
Jason
Atlanta, Ga

-----Original Message-----
Automatically open delimited files without having the 3-

step input box and
include pipes "|" in the delimiting characters.
.



All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com