+ Reply to Thread
Results 1 to 6 of 6

Copy Dynamic Web Query and paste it to another workbook

  1. #1
    Forum Contributor
    Join Date
    12-10-2014
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20368) 64-bit
    Posts
    100

    Copy Dynamic Web Query and paste it to another workbook

    Hello,

    I have a workbook that runs a dynamic web query to pull data from a box score and I have a list of dates to pull the data from. What I would like to do is once the dynamic web query pulls data for a certain day I would like to copy all of the data and paste it into another workbook automatically adding a column for the date and series name (on Sheet2) as well that the data was pulled from keeping all one seasons data in one workbook. I have attached the workbook that I am able to pull the data using the dynamic web query and also attach the dynamic web query code that helps pull the data. Any help with this would be greatly appreciated. Thanks in advance for your help.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Copy Dynamic Web Query and paste it to another workbook

    Hi - can you clarify the below please?

    Is sheet 1 what gets returned from running the query?
    Is sheet 2, without columns M & N, created by pulling data from sheet 1 each time?
    And are you wanting to create a new workbook for each year? So one for 73, another for 78, and so on.
    Is sheet 2 populated as shown by running the query once or 28 times to generate each year?

    The first three questions are just making sure I understand what you're after; the last question is important because I need to know if the code you want is to be run after each new year has been added to sheet 2 or once sheet 2 is fully populated and all years have been added.

    If there is a choice, I recommend the latter option as that means the new code will run just once and won't interrupt your query from running each time.
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  3. #3
    Forum Contributor
    Join Date
    12-10-2014
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20368) 64-bit
    Posts
    100

    Re: Copy Dynamic Web Query and paste it to another workbook

    Hi MatrixMan,

    - Yes, Sheet1 is what gets returned from running the query

    - Sheet2 is data that I generated from pulling the schedule from the website and created M & N to reflect the date and series name

    - If it is possible to create a new workbook that would be great, but if it's easier to create into one workbook that could work for me too.

    - The second option would be ideal to run as like you said it would the code would run once and not interrupt the query from running each time.

    I appreciate your help with this. Let me know if there is anything else you need from me.

  4. #4
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Copy Dynamic Web Query and paste it to another workbook

    OK - so you want a query to run over the data in Sheet 2 and create a new workbook for each of the 28 groups of data. I'll spend some time on this over the weekend - let me know if this is not what you're after!

  5. #5
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Copy Dynamic Web Query and paste it to another workbook

    If you put the following in the Sheet2 object and run the ParseListCopyData routine, that should do it.
    Please Login or Register  to view this content.
    When testing, you will create multiple workbooks which will be a pain to close (28 with your test data), so put the following in the ThisWorkbook object and run it to close all the workbooks you created.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    12-10-2014
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20368) 64-bit
    Posts
    100

    Re: Copy Dynamic Web Query and paste it to another workbook

    This works. Thanks for your help!

+ 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 Data from Dynamic Web Query to Another Workbook
    By kingsdime29x in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2016, 10:26 AM
  2. [SOLVED] Query Copy Data from one workbook to another workbook IF 2 x Criteria's match
    By Excel_Padwan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2015, 02:58 AM
  3. Copy a range based on dynamic row numbers and paste into another workbook
    By Grizz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2013, 02:07 PM
  4. How to copy a dynamic range with VBA and paste in another workbook?
    By cody4334 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2013, 12:01 AM
  5. Web Query dynamic destination or VBA to copy and paste new data alongside existing data
    By Marbleking in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2012, 06:03 PM
  6. Query, copy & paste
    By ThalesNate in forum Excel General
    Replies: 9
    Last Post: 02-02-2006, 10:24 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