+ Reply to Thread
Results 1 to 14 of 14

Extarcting a username from a list of tweets

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Extarcting a username from a list of tweets

    Hello Excel Friends,

    I have a list of tweets, and I would like to extract just the username found within the tweet. I'm not sure if a formula is the best way to do this, or possibly a macro, which is why I'm posting in the general forum. I don't have any experience in coding, but I'll willing to learn, if only you guys can point me in the right direction.

    The example I've attached is only of 18 tweets, but the spreadsheet I'm looking to use this on is 100,000+ tweets, so I need something easily scalable. One thing to note is that a tweet can have more than oneuser mentioned in it, such as the first tweet in the example.

    Thanks in advance for all help, I greatly appreciate it!
    Tweet Example.xlsx

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

    Re: Extarcting a username from a list of tweets

    Try the attached
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Extarcting a username from a list of tweets

    Thanks jindon for your help!

    I've been trying to modify this macro to add one small step, and I can't figure it out. Any help is greatly appreciated.

    The tweets have a date attached, in column C. And I want to keep transfer that to the new worksheet too. I've attached a revised file to show the "new" current and desired format.

    Thanks!!!
    Attached Files Attached Files

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

    Re: Extarcting a username from a list of tweets

    You mean like this?
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Extarcting a username from a list of tweets

    Quote Originally Posted by jindon View Post
    You mean like this?
    Exactly! I can't wait till I can finally figure this stuff out on my own! Thanks for your help!!!

  6. #6
    Registered User
    Join Date
    12-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Extarcting a username from a list of tweets

    Hi jindon, and excel friends!

    I'm trying to slightly modify this macro to have like 15 more columns like date (column C), that also transfer to the new worksheet.

    I modifyied the code, and it works with my sample, but when I apply it to my actual dataset, with 17,000+ rows, I get an error.

    Run-time error '1004':
    Application-defined or object-defined error

    When when I go to the debug,I get a yellow highlight in the 4th to last line of the code (".Value = b")

    Here is the code I've slightly modified to include all the additional columns I want to keep.

    Please Login or Register  to view this content.
    Last edited by LuckyStrike; 01-24-2013 at 12:37 PM.

  7. #7
    Registered User
    Join Date
    12-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Extarcting a username from a list of tweets

    Note:

    I just realized that when I break the data into smaller chunks, like 3,000 rows at a time, and run the macro on each individual chunk, it runs fine. It just comes up with the error when I try and run it on all 17,000 rows at once.

    Hopefully that helps as a clue to help me solve this!

  8. #8
    Registered User
    Join Date
    12-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Extarcting a username from a list of tweets

    The macro has been working perfectly, so thanks for the help Excel Forum!!

    I have one small question. How would I change this code to also create a row for tweets that do not mention anyone? Right now, a row is just created if a tweet has an "@username", but I would also like to create a row if there is no one mentioned. The first column would have the tweet author, and the second column would just be blank. I've been trying to figure it out for awhile, but I can't seem to get it. Thanks for the help!!


    Quote Originally Posted by jindon View Post
    You mean like this?
    Please Login or Register  to view this content.

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

    Re: Extarcting a username from a list of tweets

    See if this is what you wanted.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    12-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Extarcting a username from a list of tweets

    Amazing. Absolutely perfect!! Thank you so much!!!

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

    Re: Extarcting a username from a list of tweets

    You are welcome.

  12. #12
    Registered User
    Join Date
    12-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Extarcting a username from a list of tweets

    Quote Originally Posted by jindon View Post
    You are welcome.
    jindon - what part would I edit to include more rows like column C (date)? also, is it possible to make this start at row 2, so it doesn't wipe out my column headers? If not, no big deal, as I can add them back in after the usernames are extracted.

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

    Re: Extarcting a username from a list of tweets

    This should add the header in the result, but I don't understand the rest.
    If you upload the file with your desired result, it may help to understand.
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    12-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Extarcting a username from a list of tweets

    I've come back to this macro, and now when I try and run it, I'm getting an error. Any help debugging would be much appreciated.

    Run-time error '13': Type missmatch

    Please Login or Register  to view this content.
    Last edited by LuckyStrike; 04-07-2014 at 10:44 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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