I have gotten this code below, it has worked in excel and I have had someone go through it to ensure it works but just not enough time for EIKON to calculate all the values (stocks) that are in A270:A371. This program is suppose to enter values from A270:A371 into Homepage J2 that will give different ratings on stocks that are in Investing A249:B260, then the code proceeds to copy Investing a249:B260 and start pasting values into Daily strategies E5 (G5,I5,K5,etc.). You can see the macro working and changing through the values that are in A270:A371 but it is not allowing EIKON to calculate for bringing in all prices for each stock. When you do this one stock at a time it will work but not update through the macro. I need a line of code to tell EIKON to update/calculate each time a new value gets pasted into Homepage J2. Let me know what else you may need, and I can answer your questions.
Sub insertVarious()
'Application.CalculateFullRebuild
Const hpgName As String = "Homepage"
Const hpgCell As String = "J2"
Const invName As String = "Investing"
Const invAddr As String = "A249:B260"
Const invAddr2 As String = "A270:A371"
Const dstName As String = "Daily Strategies"
Const dstFirst As String = "E5"
Dim wb As Workbook: Set wb = ThisWorkbook
Dim hpg As Range: Set hpg = wb.Worksheets(hpgName).Range(hpgCell)
Dim inv As Range: Set inv = wb.Worksheets(invName).Range(invAddr)
Dim inv2 As Range: Set inv2 = wb.Worksheets(invName).Range(invAddr2)
Dim UB1 As Long: UB1 = inv.Rows.Count
Dim UB2 As Long: UB2 = inv.Columns.Count
Dim NoA As Long: NoA = inv2.Rows.Count
Dim Daily As Variant: ReDim Daily(1 To UB1, 1 To NoA * UB2)
Dim Curr As Variant, j As Long, k As Long, l As Long
For j = 1 To NoA
hpg.Value = inv2.Cells(j).Value
'hpg.Parent.Calculate
'inv.Parent.Calculate
Curr = inv.Value
GoSub writeDaily
Next j
wb.Worksheets(dstName).Range(dstFirst).Resize(UB1, NoA * UB2) = Daily
MsgBox "Data transferred.", vbInformation, "Success"
Exit Sub
writeDaily:
For k = 1 To UB1
For l = 1 To UB2
Daily(k, (j - 1) * 2 + l) = Curr(k, l)
Next l
Next k
Return
End Sub