Hi there,

I am struggling with the following, and am hoping someone can offer me either a step-by-step guide to creating the appropriate code, or some other solution that will make sense to a newbie. Apologies in advance for any naive errors.

I am using NodeXL (a free Excel add-in) to pull Twitter data for my dissertation research. One column of data contains URLs for the Twitter pages corresponding to each tweet ID. Another column contains tweet IDs for some of the tweets, indicating the Tweet ID linked to the URL. However, when I click the link to the Twitter page for any tweet, the URL is often redirected to another URL (the original tweet, in the case of retweets, replies, and mentions). I need to capture the resolved URL, and paste it into a new column (or even another workbook, as I can copy and paste later). So what I'm seeking is the Visual Basic code to loop through the URLs in Column A, open each URL and let it load, then grab the resolved URL (appears after any redirect) and paste it into Column B.

For example, here's a small sample of the list of tweet URLs I need to convert. I've manually entered the results for the first three.

URL last 18 digits of URL last 18 digits of resolved tweet ID
Twitter Page for Tweet Imported ID Resolved Tweet ID
https://twitter.com/#!/latimes/statu...39148254556160 623239148254556160 623237868979253248
https://twitter.com/#!/latimes/statu...70778000732161 622270778000732161 622270264076816384
https://twitter.com/#!/latimes/statu...00960997752833 622600960997752833 622566628455137280
https://twitter.com/#!/latimes/statu...33564764049409 622233564764049409
https://twitter.com/#!/latimes/statu...36460092104704 622236460092104704
https://twitter.com/#!/latimes/statu...40696301395968 622240696301395968
https://twitter.com/#!/latimes/statu...43252058595328 622243252058595328
https://twitter.com/#!/latimes/statu...44497892732928 622244497892732928
https://twitter.com/#!/latimes/statu...45717235646465 622245717235646465
https://twitter.com/#!/latimes/statu...49501370281985 622249501370281985
https://twitter.com/#!/latimes/statu...53272640942081 622253272640942081
https://twitter.com/#!/latimes/statu...57105198809088 622257105198809088
https://twitter.com/#!/latimes/statu...60813664022528 622260813664022528
https://twitter.com/#!/latimes/statu...64583810588672 622264583810588672
https://twitter.com/#!/latimes/statu...68370998702085 622268370998702085

I have several thousand of these to convert, so manual processing is extremely undesirable. I'm using NodeXL on an old Dell PC (Microsoft Excel 2010), but I typically work on a Mac. Happy to work on whatever platform you advise for the most expedient solution.

Many, many thanks,