Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

Web Query - Listing data before an auto refresh brings in new data

Latest post Thu, Apr 17 2008 12:13 PM by dkusleika. 2 replies.
  • Fri, Apr 11 2008 11:31 AM

    • Rob Dunphy
    • Top 500 Contributor
    • Joined on Fri, Apr 11 2008
    • Posts 1
    • Points 37

    Web Query - Listing data before an auto refresh brings in new data

    Hi, I'm new to the site as a member but have looked in from time to time to get a few pointers. No-one has asked this question though so I hope there is an answer that can help.

    I am trying to record the usage of toner and fuser consumables on 16 printers. I can Web Query the information in a spreadsheet for each printer easy enough, however, what I am trying to do is automate the information into a list before new information is refreshed.

     Is there anyway this can be done..?

    • Post Points: 37
  • Fri, Apr 11 2008 7:00 PM In reply to

    • Nick Hodge
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Southampton
    • Posts 336
    • Points 5,771
    • MVP

    Re: Web Query - Listing data before an auto refresh brings in new data

    Rob

    I'm sure there is, if you have the data in an Excel sheet it can be copied off somewhere at set intervals. There may be an event you can use to to this just after the data refreshes (Worksheet_Change() etc (This code takes the data in A1:A30 and pastes it to the same range on sheet2 if there is any change in the data

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    Range("A1:D30").Copy Destination:=Worksheets("Sheet2").Range("A1:D30")
    Application.EnableEvents = True
    End Sub
     
    or you could use an OnTime action in VBA which fires at set intervals.

    It might help to know a little more detail to be more specific, but I am sure it's do'able.

    Regards
    Nick Hodge
    Microsoft MVP, Excel
    Southampton, UK

    Filed under:
    • Post Points: 5
  • Thu, Apr 17 2008 12:13 PM In reply to

    • dkusleika
    • Top 75 Contributor
    • Joined on Wed, Jan 9 2008
    • Omaha
    • Posts 4
    • Points 168
    • MVP

    Re: Web Query - Listing data before an auto refresh brings in new data

    Rob:  You can also use QueryTable events, but you'll have to use a custom class.  I'd use the BeforeRefresh event http://www.dailydoseofexcel.com/archives/2004/06/21/classes-other-events/ 

    Dick Kusleika http://www.dailydoseofexcel.com
    • Post Points: 5
Page 1 of 1 (3 items) | RSS
Copyright Excel User Group and the relevant contributors, 2008. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.