+ Reply to Thread
Results 1 to 9 of 9

VBA scrape data from website HTML

  1. #1
    Registered User
    Join Date
    02-11-2017
    Location
    PT
    MS-Off Ver
    2015
    Posts
    6

    VBA scrape data from website HTML

    Hi,

    I made a VBA code that scrapes the morningstar dates of some mutual fund quotes, and places them in a column, right to the fund id.
    Nevertheless, I have been trying to code the exact same operation, but instead of placing fund ID on a column, place it on a line, and expect excel to scrape the dates on the line below, just like indicated:

    screenshot.PNG


    Could you be so kind as to show me how can I fix my code to do so?

    .xls file:

    https://we.tl/BMFb7jDGAc


    VBA code:

    Please Login or Register  to view this content.

    Thanks so much!
    Last edited by Strutland; 02-11-2017 at 11:36 AM.

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

    Re: VBA scrape data from website HTML

    This will transpose the data in rows below.
    Add the bolded lines of code at the bottom of your macro.

    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.

  3. #3
    Registered User
    Join Date
    02-11-2017
    Location
    PT
    MS-Off Ver
    2015
    Posts
    6

    Re: VBA scrape data from website HTML

    Thanks AlphaFrog, but your change only transposes my colums.
    What I need, is that excel takes my input on a line, and answers on the line below, just like on this pic:

    screenshot2.PNG

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA scrape data from website HTML

    May be
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

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

    Re: VBA scrape data from website HTML

    Change the range to suit.

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 02-11-2017 at 01:55 PM.

  6. #6
    Registered User
    Join Date
    02-11-2017
    Location
    PT
    MS-Off Ver
    2015
    Posts
    6

    Re: VBA scrape data from website HTML

    Quote Originally Posted by YasserKhalil View Post
    May be
    Please Login or Register  to view this content.
    Thank you very much YasserKhalil, this code was exactly what I was looking for.

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA scrape data from website HTML

    You're welcome.Glad I can offer some help
    As for Mr. AlphaFrog's post #5, I think it is working well too (Have it a test)

  8. #8
    Registered User
    Join Date
    02-11-2017
    Location
    PT
    MS-Off Ver
    2015
    Posts
    6

    Re: VBA scrape data from website HTML

    Quote Originally Posted by AlphaFrog View Post
    Change the range to suit.

    Please Login or Register  to view this content.
    Thank you very much as well AlphaFrog, you code works like a charm!
    You two have helped me a lot!

    Best of luck!

  9. #9
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA scrape data from website HTML

    You're welcome. Please mark the thread as solved

+ 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] How to Scrape information from a website and put in specific column of existing worksheet.
    By Glove83 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-22-2015, 11:44 AM
  2. Scrape website using VBA
    By cfcMalky in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-26-2014, 08:59 PM
  3. Logon daily to website, Scrape data, and paste into Excel 2003 Using VBA
    By Gloopie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2014, 09:25 AM
  4. Scrape, pull or get data from a Website into Excel Please help me out
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2014, 01:42 PM
  5. VBA Macro to Scrape Website - Post to Javascript
    By shahzeb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2014, 05:53 PM
  6. [SOLVED] Pull Specific Data from Website (Screen Scrape)
    By CHRISEWRIGHT20 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-11-2012, 11:03 AM
  7. VBA to scrape data from website
    By jdub22cb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2012, 04:00 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