+ Reply to Thread
Results 1 to 10 of 10

Web Query Macro Change, New Page per Query

  1. #1
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Cape Town South Africa
    MS-Off Ver
    Excel 2007
    Posts
    133

    Web Query Macro Change, New Page per Query

    Hi All, I have obtained the following code from a previous post. This Macro works perfectly, but I would like it modified so that each webquery/import goes into a new worksheet a.o.p to all the data going into 1 worksheet.
    There is a comment within the code ' Add new worksheet to store data and try to rename. Don't understand this cause no new sheets are added.


    Thanking you in advance

    Floyd



    Please Login or Register  to view this content.
    Last edited by Floydlevedale; 10-10-2012 at 01:53 AM. Reason: So as to comply with Forum Rules

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Change Macro

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.


    If you do a Google search for "change macro" you get: "About 140,000,000 results (0.19 seconds)"
    Last edited by protonLeah; 10-10-2012 at 01:44 AM.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Cape Town South Africa
    MS-Off Ver
    Excel 2007
    Posts
    133

    Re: Change Macro

    Apologies for the Inadvertant infringement, have made the necessary adjustment.

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Web Query Macro Change, New Page per Query

    Try something like this:

    Please Login or Register  to view this content.
    instead of

    Please Login or Register  to view this content.
    As for your error handling, it's usually not advisable to tell Excel to forget about all errors as if they have never happened. It's better to learn how to debug, trap errors and handle them accordingly.

    Hope this helps.

    abousetta
    Last edited by abousetta; 10-10-2012 at 03:17 AM. Reason: Corrected code
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  5. #5
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Cape Town South Africa
    MS-Off Ver
    Excel 2007
    Posts
    133

    Re: Web Query Macro Change, New Page per Query

    Hi, Thanks for the reply, but havent managed to get it to work yet.

    Do I replace the this block of code, with your piece of code.

    Please Login or Register  to view this content.
    When I do the above it gives an error, i.e highlights the following code in yellow.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Web Query Macro Change, New Page per Query

    Yes, I forgot to set the variable. I changed my post above. It should work now.

  7. #7
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Cape Town South Africa
    MS-Off Ver
    Excel 2007
    Posts
    133

    Re: Web Query Macro Change, New Page per Query

    Hi, It still only saves each webquery to a single sheet.

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Web Query Macro Change, New Page per Query

    Try this modified version:

    Please Login or Register  to view this content.
    abousetta

  9. #9
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Cape Town South Africa
    MS-Off Ver
    Excel 2007
    Posts
    133

    Re: Web Query Macro Change, New Page per Query

    Thanks, works perfectly now.

  10. #10
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Web Query Macro Change, New Page per Query

    Glad I was able to be of assistance.

    Good luck.

    abousetta

+ 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