hi
if you like to import the delimited text file into excel Vba
Here is the code
Sub delimit_txt_file()
Dim swa As Workbook
Dim textfilename As Variant
textfilename = Application.GetOpenFilename _
(FileFilter:="Text Files (*.txt), *.txt", _
Title:="Select File To Be Opened")
'---- set true as per your requirement and change the charater in other if required
Workbooks.OpenText Filename:=textfilename, Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _
, Space:=False, Other:=True, OtherChar:="|"
Set swa = ActiveWorkbook
' -----
' here you can save the workbook or do formating etc..
end sub
Subscribe to:
Post Comments (Atom)
Import data from SQL
Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...
-
If you want to add a new menu on mouse right click "Workbook Navigation showing you the list of all open workbooks and worksheets in ea...
-
Macro to Export Range in Json Format Option Explicit Sub export_in_json_format() Dim fs As Object Dim jsonfile Dim rangetoex...
No comments:
Post a Comment