I have some code in which I need to pass the value of "j" from one module to another. "j" is declared in Sheet1 (Data) under the Microsoft Excel Objects.
Option Explicit
Private Sub CommandButton1_Click()
Dim i As Long
Dim j As Integer
Dim lastrow As Integer
I need to pass the value of j to a class module which is coded as follows:
Option Explicit
Private pWinHttpRequest As WinHttp.WinHttpRequest
Friend Function GetHistoricalData(Symbol As String, _
Optional FromDate As Date = #12:00:00 AM#, _
Optional ToDate As Date = #12:00:00 AM#, _
Optional Interval As String = "Daily") As ADODB.Recordset
Dim URL As String, ResponseText As String
Dim pRecordSet As ADODB.Recordset
Dim DateString As String, IntervalString As String
Dim RTS() As String, RTFI
Dim x As Long
.
I have tried a number of different options such declaring "j" has a Public Variable and trying pass "j" ByVal but can't get any of these options to work. Not sure what I am doing wrong. Thanks.
Bookmarks