Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    MN, USA
    Thanked 0 Times in 0 Posts

    Web query refreshes (2002)

    I have a file that has web queries that need to occur weekly. There are 16 weeks that need to be updated and 12 queries for each week. I have each query on it's own worksheet. These worksheets are hidden from the user.

    Is there a way to run each week's refreshes without doing the other 180 queries? I don't want to do the 12 for each week manually and I really don't want to waste time/resources by refreshing all the queries. Maybe a button for each week that will trigger the correct group of refreshes?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Pittsburgh, Pennsylvania, USA
    Thanked 342 Times in 335 Posts

    Re: Web query refreshes (2002)

    A query table is an object in a worksheet. you could use something like:

    Or if you know the names you can use the names instead of the indices:
    <pre>Worksheets("Sheet 1").querytables("Query 1").refresh</pre>

    You could name each one, based on when you want to refresh and then loop thru them all and only refresh those with a particular name format. You could have a button for each type or call one macro that prompts for a type or a userform where you can select the type and then it loops thru them. This way adding more would NOT change the macro, add ing a new one would ONLY require naming it correctly so it gets refreshed when desired.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts