+ Reply to Thread
Results 1 to 4 of 4

Data capture method

Hybrid View

  1. #1
    Registered User
    Join Date
    10-18-2008
    Location
    San Antonio
    Posts
    7

    Data capture method

    What I am trying to do is log data from a DDE linked cell. It gets real time updates from a Allen Bradley Data Highway network. I want to capture this data every 15 minutes and log it into the excel sheet for the 24 hour period.
    I have used the VBE for the sheet and put this code in worksheet event change
    Range("A65535").End(xlUp).Offset(1, 1).Value = Now
    Range("A65535").End(xlUp).Offset(1, 0).Value = Range("A1").Value
    Only problem it does the deed every time the cursor is moved
    How do I creat a 15 minute event to put this code in
    Last edited by jhaskins; 10-19-2008 at 11:17 AM.

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    macro

    Hi
    try the following codes
    Sub Jhaskins()
    Dim z As Long
    For z = 1 To 100
    Range("A65535").End(xlUp).Offset(1, 1).Value = Now
    Range("A65535").End(xlUp).Offset(1, 0).Value = Range("A1").Value
      ActiveWorkbook.Save
    PauseTime = 900 '15 min (900 sec)
        Start = Timer
        Do While Timer < Start + PauseTime
        Loop
        Next z
    End Sub
    Ravi

  3. #3
    Registered User
    Join Date
    10-18-2008
    Location
    San Antonio
    Posts
    7
    Thanks You sir I am going to study and try to apply this for a while. I know nothing about VB. But willing to try. I will get back to this thread hopefully. Think my problem has been I was drifting between forums. I must apoligize for cross posting I am going to stick with this one if I can pull it off.
    Jimmy

  4. #4
    Registered User
    Join Date
    10-18-2008
    Location
    San Antonio
    Posts
    7

    This works but it stops dde update while timer is on

    I was able to get Ravishankar's code to work for me. But while the timer is running the DDE link is not updated. Any sugestions?

    Have progressed to this point I need a variable in timeValue that I can minuplate

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    'Dim z As Long
    'For z = 1 To 10
     Application.OnTime Now + TimeValue("00:00:15"), "capture_Data"
     Application.OnTime Now + TimeValue("00:00:30"), "capture_Data"
     Application.OnTime Now + TimeValue("00:00:45"), "capture_Data"
     Application.OnTime Now + TimeValue("00:01:00"), "capture_Data"
     Application.OnTime Now + TimeValue("00:01:15"), "capture_Data"
     Application.OnTime Now + TimeValue("00:01:30"), "capture_Data"
     
     
    'Next z
    End Sub
    That way I will not have to enter all these times. I would need 96 of them for a 24 hour day. Itried to call this over and over as a function then as a macro but it never resets to now it continues from start of application.
    Last edited by jhaskins; 10-22-2008 at 09:10 AM. Reason: Had no response

+ 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. Data and number manipulation
    By Mwhite in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2015, 06:41 AM
  2. Capture data
    By delboy2405 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2007, 11:31 AM
  3. Capture Data from Cell
    By delboy2405 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-29-2007, 01:14 PM
  4. importing data:What i would like to do is be able to import
    By censura in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2007, 08:32 AM
  5. Macro to create new sheets from master data sheet
    By adsigel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2006, 09:21 AM

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