The more I research the farther back my Questions go. We still need to know the answers to all my previous, but the decisions also depend on how you use BA. You use Guardian, correct? Because its multi sheet sync sounded good?
First, allow me to introduce you to an Excel Application Object, the WorksheetFunction Object. When you click the fx icon on the Menu Bar, you are opening the WorksheetFunction's DialogBox. This DialogBox lists all Excel Builtin Functions, Including a slew of Financial Functions. It can also list all UserDefined Functions,which are written in VBA.
VBA can use all Builtin Functions by invoking a WorksheetFunction Object. Most commonly by just calling the Application's WsF Object. However, because Speed Is Of The Essence in this situation, I will introduce the concept of New Objects, that only reside in RAM.Depending on exactly where we place each of those two lines, we can use any Excel Function from RAM in any code by merelyCode:
Dim WsF As Object
Set WsF = New Application.WorksheetFunction
Code:
X = WsF.Function Name(Function Parameters)
Can we call this App you're working on, "An Automated Betting App with Custom Functions and Rules Based on Get Angel and MS Excel?" The Rules system of BA is based on Cell String Values. Excel soars on Numerical analysis, VBA on Data Manipulation.
All that VBA needs to put the appropriate Values in some Excel Cells is the main Get Angel Sheet. If you want to archive the BA stream, the "Interesting Reading" link above mentions a fast method.
I see...
Two sheets, the main BA Sheet and the "Overview" Sheet they you stare at... Uh... I meant study. Also on that sheet VBA needs a block of Cells to "talk" to BA with and a block to "read" what Parameters you give it. At this Time, I only see three Standard VBA Code Modules; Globals, Math Functions, and The Works. The ThisWorkbook Code Module will count BA Updates and Call "The Works" when desired. "The Works" will have to set a Flag when it is ready to start over.
For now, I, we, still need more information about Ba's update style. Drop this code into the Bet Angel Code page. 9 to 4 minutes before a monitored Race, Run StartLogging from the Macro menu or the VBA Editor.As soon as you're done with this, Change the Name of "Private Sub Worksheet_Change." Something as simple as "Private Sub ***Worksheet_Change" will work. You may want to save this code somewhere. Write Comments so you remember how and why to use it. :DCode:Option Explicit
Const RecordingLength = 1000 'Records. 'Adjust to suit
Const RecordingTime = 3 'Minutes 'Adjust to suit
Dim Running As Boolean
Dim Recording(1 To RecordingLength, 1 To 2)
Dim i As Long
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Running Then Exit Sub
If Target.Row < 45 Then Exit Sub
Recording(i, 1) = Target.Address
Recording(i, 2) = Now
i = i + 1
If i > RecordingLength Then
Running = False
SaveRecording
End If
End Sub
Private Sub SaveRecording()
Worksheets.Add Before:=Sheets("Bet Angel")
ActiveSheet.Range("A1:B" & CStr(RecordingLength)) = Recording
End Sub
Private Sub RecordingTimer()
Application.OnTime Now + TimeValue("00:" & CStr(RecordingTime) & ":00"), "StopLogging"
End Sub
Public Sub StopLogging()
If Running Then
Running = False
SaveRecording
End If
End Sub
Public Sub StartLogging()
Recording(1, 1) = "Changed Address"
Recording(1, 2) = "Time of Change"
i = 2
RecordingTimer
Running = True
End Sub