+ Reply to Thread
Results 1 to 13 of 13

Paste address list from website to Excel

  1. #1
    Registered User
    Join Date
    07-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    32

    Paste address list from website to Excel

    Hi guys. I am trying cut and paste a list into Excel, and have Excel separate the different fields for me. There are 12 lines per each entry on the list. I use Firefox as my browser, and when I cut and paste using Firefox into Excel, this is how it looks:

    James H. Patel, MD
    (space)
    Pediatrician
    (space)
    14642 Newport Ave Ste 450
    Tustin, CA 92780
    (space)
    (space)
    30 Years Experience
    1 Office Location
    30 Insurance Carriers
    (space)
    Mark P. Smith, DO
    Etc.
    Etc.

    I知 hoping for the final product to look like this:
    Last Name----First Name----whether MD or DO----Street Address----City, State, Zip code----Zipcode(by itself)

    The website that I知 copying and pasting from is: http://doctor.webmd.com/results?city...ame=Pediatrics

    Any help would be much appreciated because I don稚 know what I知 doing and I致e been coming up with garbage like:
    =LEFT(INDEX($A:$A,(ROW()-1)*4-2),FIND(",",INDEX($A:$A,(ROW()-1)*4-2))-1)

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Paste address list from website to Excel

    1. In your workbook, create a sheet called WebMD, and add your column headings.
    2. Insert a code module and paste the code below into it.
    3. On the Developer tab, click Macros, select PasteWebMD, and click Options.
    4. For the Shortcut key, enter p (for Paste), and click Ok and Cancel.
    5. Save the workbook as a .xlsm (macro-enabled)

    The above is one-time only and sets up the functionality. Then ...

    1. On the web page, go to the 1st page.
    2. Press Ctrl-A (Select All) and Ctrl-C (Copy).
    3. Flip over to the WebMD workbook and press Ctrl-P.
    4. Go back to the browser, select the next page, and repeat steps 2 & 3.
    5. Continue until you have all the pages.

    To avoid needing the mouse, use Alt-Tab to flip back & forth.

    You may need to make adjustments if you come across odd names or other issues, but this worked for the 1st 5 pages or so.

    Maybe there's a better way to grab a full table out of a web site, but this is the only way I know how to do it.
    Please Login or Register  to view this content.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    07-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Paste address list from website to Excel

    Natefarm. Thank you, thank you, thank you!!!!! I've been banging my head against the wall trying to do this stuff (unsuccessfully, I might add). The method you have created will make things much less tedious and labor intensive than I could ever imagine. It's everything I could have hoped for! I appreciate your time and effort. Thank you a million more times Natefarm!

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,908

    Re: Paste address list from website to Excel

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    07-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Paste address list from website to Excel

    I have another question. Using the method you have devised, can you combine entries that have the same address? For example:

    Last Name-----First Name-----Street Address---------City, State and Zip Code
    Patel---------James----------9876 Willis Avenue-----Los Angeles, CA 91503
    Smith---------Mark-----------9876 Willis Avenue-----Los Angeles, CA 91503
    Johnson-------Fred-----------9876 Willis Avenue-----Los Angeles, CA 91503
    Reddy---------Gloria---------589848 Kester Blvd-----Portland, OR 543215
    Martinez------David----------589848 Kester Blvd-----Portland, OR 543215

    I知 hoping for the final product to look like this:

    Last Name------------------------Address---------------City, State, and Zip Code
    Patel, Smith, Johnson------------9876 Willis Avenue----Los Angeles, CA 91503
    Reddy, Martinez------------------589848 Kester Blvd----Portland, OR 543215


    Would it be easier to do this by creating a new macro, separate from the one that you have already graciously devised? Because this time, I知 only concerned about combining last names that have the same address, rather than all of those other variables/fields. Thank you once again.

  6. #6
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Paste address list from website to Excel

    Well, I'm going to assume that since you already have the WebMD worksheet built, you don't want to have to start all over, going through all the web pages again, so let's treat it as a separate process. The following will make a copy of the WebMD sheet, then convert the data to be as you requested. If it's messed up or we want to make adjustments and do reruns, you'll have your original data intact.

    I noticed that the addresses aren't consistent, so you'll still get some duplication, but it will be close.

    Copy and paste the following after the existing subroutine and run it separately (just put your cursor somewhere in the subroutine and hit F5).
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Paste address list from website to Excel

    Natefarm. Thank you once again! Not only did you create something better than what I could imagined you made it simple for me to execute by putting basic instructions that even a rookie like me can follow. Thank you so much for your time and assistance!!!

  8. #8
    Registered User
    Join Date
    07-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Paste address list from website to Excel

    Hi guys. I am trying to cut and paste a list into Excel, and have Excel separate the different fields for me. There are 11 lines per each entry on the list. I use Firefox as my browser, and when I cut and paste using Firefox into Excel, this is how it looks:


    James H. Patel, MD
    (space)
    Pediatrician
    (space)
    14642 Newport Ave Ste 450
    Tustin, CA 92780
    (space)
    30 Years Experience
    1 Office Location
    30 Insurance Carriers
    (space)
    Mark P. Smith, DO
    Etc.
    Etc.


    I’m hoping for the final product to look like this:
    Last Name----First Name----whether MD or DO----Street Address----City, State, Zip code----Zipcode(by itself)

    The website that I’m copying and pasting from is:
    http://doctor.webmd.com/find-a-docto...fornia/anaheim

    I've been trying really hard to understand this stuff, so any help would be greatly appreciated.
    Last edited by caunyd; 01-15-2015 at 10:14 PM.

  9. #9
    Registered User
    Join Date
    07-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Paste address list from website to Excel

    Previously, Natefarm wrote this beauty for me. However, this was when each entry was 12 lines, rather than 11, as it is now. And also the WebMD website might have changed too. Therefore, what Natefarm created doesn't seem to be working anymore. Back then when I cut and pasted from Firefox, it had 1 extra line, and looked like this:

    James H. Patel, MD
    (space)
    Pediatrician
    (space)
    14642 Newport Ave Ste 450
    Tustin, CA 92780
    (space)
    (extra space)
    30 Years Experience
    1 Office Location
    30 Insurance Carriers
    (space)
    Mark P. Smith, DO
    Etc.
    Etc.

    This is what Natefarm create:
    Quote Originally Posted by natefarm View Post
    1. In your workbook, create a sheet called WebMD, and add your column headings.
    2. Insert a code module and paste the code below into it.
    3. On the Developer tab, click Macros, select PasteWebMD, and click Options.
    4. For the Shortcut key, enter p (for Paste), and click Ok and Cancel.
    5. Save the workbook as a .xlsm (macro-enabled)

    The above is one-time only and sets up the functionality. Then ...

    1. On the web page, go to the 1st page.
    2. Press Ctrl-A (Select All) and Ctrl-C (Copy).
    3. Flip over to the WebMD workbook and press Ctrl-P.
    4. Go back to the browser, select the next page, and repeat steps 2 & 3.
    5. Continue until you have all the pages.

    To avoid needing the mouse, use Alt-Tab to flip back & forth.

    You may need to make adjustments if you come across odd names or other issues, but this worked for the 1st 5 pages or so.

    Maybe there's a better way to grab a full table out of a web site, but this is the only way I know how to do it.
    Please Login or Register  to view this content.
    I've been trying to modify what he wrote, but it is far beyond my rudimentary skills.

  10. #10
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Paste address list from website to Excel

    It does appear that the web page layout has changed. I've adjusted the code. See if this works better.
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    07-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Paste address list from website to Excel

    Natefarm, thanks once again for putting in the time and effort and coming to the rescue! I was re-reading your original instructions, it's funny, but probably knowing what a rookie I am, you even went so far as to tell me how to use Alt-tab to flip back and forth without the mouse. Your code made this process exceedingly and elegantly efficient and simple for me. Thank you, thank you, thank you again.

  12. #12
    Registered User
    Join Date
    07-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Paste address list from website to Excel

    Natefarm, not all the address have a suite number, but when they do, is it possible to separate the street address from the suite number, and put the suite number into another column? Also is it possible to separate the city too? So it looks like:

    Last Name----First Name----whether MD or DO----Street Address----Ste Number----City, State, Zip code----City (by itself)----Zipcode(by itself)

    Thanks again
    Last edited by caunyd; 01-21-2015 at 11:07 PM.

  13. #13
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Paste address list from website to Excel

    Replace the main Do - Loop portion of the code with the following:
    Please Login or Register  to view this content.

+ 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. Copy/Paste from Excel to Website Issue
    By boswelljw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-10-2013, 09:09 AM
  2. [SOLVED] Paste address list from website to Excel
    By caunyd in forum Excel General
    Replies: 21
    Last Post: 08-03-2013, 02:41 AM
  3. How can I copy-and-paste hyperlinks from a website to a spreadsheet in Excel for Mac 2011?
    By RexLafferty in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 02-28-2013, 02:04 PM
  4. Copy/Paste - From a website to Excel
    By ZenBaller in forum Excel General
    Replies: 4
    Last Post: 08-08-2010, 07:45 PM
  5. copy and paste data from website to excel
    By aishaz_88 in forum Excel General
    Replies: 2
    Last Post: 12-02-2007, 09:52 PM

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