+ Reply to Thread
Results 1 to 6 of 6

Getting WhatsApp exported data as rows using VBA

  1. #1
    Registered User
    Join Date
    11-07-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    71

    Question Getting WhatsApp exported data as rows using VBA

    Hello Happy Excel Users!

    I have a bit of a weird problem. I have made an analyser for WhatsApp in Excel, but it is very system heavy, so I thought I would make it in VBA to ease calculations.

    Most of that process is straight forward, but I have run into a weird problem. When I manually open and copy-paste from the exported .txt file, the conversations are pasted as 1-column data with a message on each row. That's good and workable!

    However, any method I have tried with VBA pastes the .txt contents as all in one cell - not good. I'd really like the user to be able on just choosing the file in FSO and have the database made. The problem of the .txt file seems to be that it is not delimited in any specific manner... How copy-paste Excel handles that, I have no idea.

    Any advise on how to do this?

    Attachments here won't work (it's blank, weird), so here's a link to a small WhatsApp exported file: https://1drv.ms/t/s!ArSYCsSUTeLolYhhZ-OPIwgA226a2w

    Thank You,


    GregersDK
    Last edited by gregersdk; 01-08-2019 at 11:33 AM. Reason: More info

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Getting WhatsApp exported data as rows using VBA

    There are several ways to do this. 1 method is to use Workbooks.OpenText.

    You can use macro recorder to get basic syntax.

    Ex:
    Please Login or Register  to view this content.
    Last edited by CK76; 01-08-2019 at 12:00 PM.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    11-07-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    71

    Re: Getting WhatsApp exported data as rows using VBA

    I don't know how I could use the recorder for this? When I tried copy-paste method, it only recorded "paste".

    I have an interesting issue with too though.

    1) It opens a new file (but that can easily be fixed). I'm guessing it's in the name... OpenText

    2) More weird. If I have a line where the first message starts with capital F, it removes the F and moves the message to next column.
    e.g. 07/02/2017, 15:46 - John Doe: Fordi det er så mange fejl når jeg skriver på dansk becomes split into
    07/02/2017, 15:46 - John Doe: ordi det er så mange fejl når jeg skriver på dansk
    I have tried looking into that, but I cannot find a good reason for this behaviour?

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Getting WhatsApp exported data as rows using VBA

    To record OpenText process. After starting the recorder. Go to File->Open. Navigate to folder and ALL(*.*) type and open select the text file.
    It will launch text import wizard.

    1) Yes.

    2) Not sure about that one. I didn't have same issue.

    However, if OpenText isn't working for you... you can use other method. One such example below.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-07-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office 365
    Posts
    71

    Re: Getting WhatsApp exported data as rows using VBA

    Thanks for that. I don't understand the code, so need to look at it at Google my way through some of the things I don't recognise...

    I went through the text import wizard and realised I can import it just with Fixed Width and that solves the "F" issue. So for now, that solution is good


    Thank You! (I'll mark this as solved)

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Getting WhatsApp exported data as rows using VBA

    You are welcome

    And thanks for the rep.

+ 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. [SOLVED] Reorder Exported Data
    By DHFE in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-17-2016, 08:54 AM
  2. [SOLVED] organize the data exported
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-13-2013, 07:19 AM
  3. Excel exported data is not exactly.
    By indosta in forum Excel General
    Replies: 0
    Last Post: 05-14-2013, 09:37 AM
  4. Replies: 0
    Last Post: 05-20-2009, 05:37 AM
  5. Formatting exported DB data with IF(AND)?
    By firefiend in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-08-2007, 12:37 PM
  6. [SOLVED] Truncated Exported Data
    By baconroll in forum Excel General
    Replies: 0
    Last Post: 04-05-2006, 07:25 AM
  7. Arabic Data is exported as ????
    By syedmoiz in forum Excel General
    Replies: 0
    Last Post: 01-11-2005, 02:01 AM

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