+ Reply to Thread
Results 1 to 3 of 3

Transfer data automatically from RTD cells to new ones

Hybrid View

forseti7 Transfer data automatically... 08-19-2015, 12:27 PM
Bernie Deitrick Re: Transfer data... 08-19-2015, 02:15 PM
forseti7 Re: Transfer data... 08-25-2015, 03:15 PM
  1. #1
    Registered User
    Join Date
    08-19-2015
    Location
    Greece
    MS-Off Ver
    MS Office 2007
    Posts
    6

    Transfer data automatically from RTD cells to new ones

    Hello! I am new to Excel VBA and have come across multiple problems, but thankfully internet always provides good answers.

    In this case: a cell is filled with data and updated every minute with the help of the RTD function. I need to transfer those data to another cell before each minute, so that the new data can be compared to the older ones. How could this be achieved through VBA?

    Thank you in advance.

    Aki
    Last edited by forseti7; 08-26-2015 at 12:47 PM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,273

    Re: Transfer data automatically from RTD cells to new ones

    If your RTD function is in cell A2, this code will store the value every minute in column C, with a time stamp in column B. Start it by running StoreValue, and stop it by running StopStoring, which can also be called in the before close event of the workbook.


    Option Explicit
    Dim NextTime As Date
    
    Sub StoreValue()
        Dim lRow As Long
        Application.EnableEvents = False
        With Worksheets("Sheet1")
            lRow = .Cells(.Rows.Count, "B").End(xlUp).Row + 1
            .Cells(lRow, "B").Value = Now()
            .Cells(lRow, "C").Value = .Range("A2").Value
        End With
        Application.EnableEvents = True
    
        NextTime = Now() + TimeValue("00:01:00")
        Application.OnTime NextTime, "StoreValue"
    End Sub
    
    Sub StopStoring()
        On Error Resume Next
        Application.OnTime NextTime, "StoreValue", schedule:=False
    End Sub
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    08-19-2015
    Location
    Greece
    MS-Off Ver
    MS Office 2007
    Posts
    6

    Re: Transfer data automatically from RTD cells to new ones

    Your answer was very helpful! Thank you very much!

+ 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. [SOLVED] Transfer data automatically
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-06-2014, 05:57 PM
  2. [SOLVED] Automatically transfer data from one sheet to another
    By kishn697 in forum Excel General
    Replies: 10
    Last Post: 06-22-2014, 10:01 AM
  3. Automatically transfer data from one sheet to another
    By kishn697 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-18-2014, 07:05 AM
  4. Replies: 1
    Last Post: 05-03-2013, 11:38 AM
  5. Hi, Need Help to automatically transfer data
    By Bzynski in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-16-2013, 06:35 AM
  6. Transfer Data to another sheet automatically
    By jmisti2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-21-2012, 03:14 PM
  7. Purge or transfer old data automatically?
    By GemznJewlz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-18-2005, 04:20 PM

Tags for this Thread

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