+ Reply to Thread
Results 1 to 3 of 3

Recording a number in a cell every 15 minutes

Hybrid View

  1. #1
    Registered User
    Join Date
    04-16-2010
    Location
    london,england
    MS-Off Ver
    Excel 2007
    Posts
    8

    Recording a number in a cell every 15 minutes

    I am trying to record the contents of a cell every 15 minutes. The cell is linked to an IP address with a constantly moving number and I want to record this number in a cell and then record it again in another cell 15 minutes later and so on for 12 hours. Can anyone help as I am stuck.

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Recording a number in a cell every 15 minutes

    Something along the lines of:
    This stores a series of values in column E (time now) and F the result from B3
    taking the data from B3

    Sub GetData()
        Dim rng As Range
        Dim i As Long
        Dim dte As Date
        Dim dteNext As Date
        
        dte = Now
        Set rng = activesheet.Range("E1")
        For i = 1 To 3                                  'change this to number of time to loop
            ThisWorkbook.RefreshAll
            DoEvents
            Set rng = rng.Offset(1)
            rng = Now
            rng.Offset(, 1) = activesheet.Range("B3")
            dteNext = dte + TimeSerial(Hour:=0, Minute:=1 * i, Second:=0)   'change this value to number of minutes
            Application.Wait dteNext
        Next
        MsgBox "done"
    End Sub


    click on the * Add Reputation if this was useful or entertaining.

  3. #3
    Registered User
    Join Date
    04-16-2010
    Location
    london,england
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Recording a number in a cell every 15 minutes

    Thats Great thanks for the help

+ 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