+ Reply to Thread
Results 1 to 6 of 6

Importing Delimited .dat files into workbook .xlsm

  1. #1
    Registered User
    Join Date
    05-27-2020
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2

    Importing Delimited .dat files into workbook .xlsm

    Hi!

    Hope all is going well.

    I am trying to develop and/or obtain a macro that will import *.dat files into one excel workbook so I can play around with the data.

    Data is decent size.

    1. Currently I open the .dat file in Notepad, select all, copy within the opened Notepad.
    2. I then paste "Use Text Import Wizard", "delimited" already selected, Next, select "comma", deselect "space", and then finish.

    I tried to record a macro to do Step 2 but it just pastes all essentally. No comma selection.

    The recorded macro came out like this:

    Sub DataImport()
    '
    ' DataImport Macro
    '

    '
    Range("A1").Select
    ActiveSheet.PasteSpecial Format:="Unicode Text", Link:=False, _
    DisplayAsIcon:=False
    End Sub

    Shouldn't it have something to show it as delimited and the comma/space selection?

    Thank you in advance

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Importing Delimited .dat files into workbook .xlsm

    .
    Can you provide a small sample of your .DAT file ? So 25 - 50 rows ?

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Importing Delimited .dat files into workbook .xlsm

    Quote Originally Posted by Akira29466 View Post
    Shouldn't it have something to show it as delimited and the comma/space selection?
    [Date] - [From Text] - Change File Filter to "ALL(*.*)" - Select .dat file and follow the steps.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Importing Delimited .dat files into workbook .xlsm

    This will prompt you to select a DAT file and then it imports it.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  5. #5
    Registered User
    Join Date
    05-27-2020
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2

    Thumbs up Re: Importing Delimited .dat files into workbook .xlsm

    RESOLVED

    Quote Originally Posted by AlphaFrog View Post
    This will prompt you to select a DAT file and then it imports it.

    Please Login or Register  to view this content.
    AlphaFrog for the win!

    This may have trimmed 90% of my time. Worked perfectly.

    Akira

  6. #6
    Registered User
    Join Date
    08-02-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Importing Delimited .dat files into workbook .xlsm

    great stuff. thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 12-02-2019, 11:04 PM
  2. [SOLVED] Import delimited text files as new sheets in current workbook.
    By spencer_time in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2019, 08:08 AM
  3. Replies: 1
    Last Post: 02-02-2017, 06:05 PM
  4. Replies: 2
    Last Post: 10-04-2013, 10:12 AM
  5. Importing multiple Space delimited text files
    By rossw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2013, 08:56 AM
  6. [SOLVED] Copy/Save As xlsm workbook to new xlsm workbook is not copying the code with it
    By Grinchy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-02-2013, 09:30 AM
  7. [SOLVED] Importing multiple tab delimited text files
    By EKH in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2013, 12:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1