I am using RediPlus (trading software), and specifically, it's add-in to Excel. It allows me to display stock data (in my case, volume and last traded price of a certain symbol) in an assigned cell. The data is continually updated as stocks, etc, are traded, real time. Needless to say, this data can change very quickly.
I am trying to grab each instance of data and copy and paste it into a column: in other words, trying to capture each 'tic' in an Excel column. Originally, I set up the VBA code as seen below; pretty simple (snippets and clips from various places) to instigate from the Worksheet_Change event.
My issue has become (I believe) that the spreadsheet doesn't recognize that the data is changing. My macro works when you type data in the target cells and press enter. However, it doesn't when the live data is put into the cell. The data changes and the macro is not set in motion by the Worksheet_Change event.
Also--check my code--maybe I wrote it wrong. It's been awhile since I've programmed, so....
Thanks in advance--
Private Sub Worksheet_Change(ByVal Target As Range)
setTimeMin = Application.Range("B2")
setTimeMax = Application.Range("B3")
If (Time < setTimeMax And Time > setTimeMin) Then
If IsNumeric(Target) Then
If Not Intersect(Target, Range("C2:D2")) Is Nothing Then
On Error Resume Next
Application.EnableEvents = False
rowCountA = Application.CountA(Range("C:C")) + 1
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range("C" & rowCountA & ":D" & rowCountA)
Worksheets("Sheet1").Range("E" & rowCountA).Value = Time
Application.CutCopyMode = False
Application.EnableEvents = True
On Error GoTo 0