Help with copying data from one worksheet to another automatically in real time

PatR78

New Member
Joined
Aug 10, 2017
Messages
6
Hi,

I have an excel spreadsheet that is connected to external software and it populates in real time. I'm trying to learn how I can extract certain data from this sheet to another sheet in real time at 2 second intervals and list this information every 2 seconds so later in the day I can then load this data into a line chart and analyse is. Even better would be if this data could automatically be entered into a chart without me having to do it manually but that's being greedy!

I would also need a button of some kind so I can start and stop the retrieval of data as I don't want it to go on 24 hours a day.

Any help with this would be greatly appreciated, I've spent the past few hours online looking for how this can be done but I only have basic Excel skills so don't know where to even begin.

Thanks in advance
Pat
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Not much to go here detail wise but as a basic example (without the directly entering into the chart bit)...

Put all the code below in a regular module, then with a blank sheet put a number in A1, then put 2 buttons on the sheet.
.
Assign startime macro to one button and endtime macro to the other button and click the startime button.

Code:
Public MyTime As Date

Sub startime()
    MyTime = Now + TimeValue("00:00:02")
    Application.OnTime MyTime, "MyMacro"
End Sub

Sub endtime()
     'Cancel OnTime
    Application.OnTime MyTime, "MyMacro", , False
End Sub

Sub MyMacro()
Range("B" & Rows.Count).End(xlUp)(2).Value = Range("A1").Value
Range("A1").Value = Range("A1").Value + 1
startime
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,929
Messages
6,181,819
Members
453,067
Latest member
mdiz777

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top