Hi, new here, pleased to meet you all.
I have only v little experience with VB and have done the coding as below but keep getting a Type Mismatch error 13. It would be great if someone could tell me why this is happening and point me in the direction to correct it.
The cells in XL sheet contain continuously updated DDLs (eg.=MT4|BID!EURUSD)
TIA
Public PairVals
Public OnOff
Private Sub CommandButton1_Click()
End Sub
Private Sub Workbook_Open()
ReDim PairVals(2, 50) As Double
OnOff = 0
Sheet1.CommandButton1.Enabled = False
Sheet1.CommandButton2.Enabled = True
j = 0
For x = 2 To 152 Step 3
PairVals(0, j) = Sheet1.Cells(4, x).Value ' each link stored in array
PairVals(1, j) = Sheet1.Cells(4, (x + 1)).Value
j = j + 1
Next x
End Sub
-------------------------------------------------------------------
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
If OnOff = 0 Then
j = 0
For x = 2 To 152 Step 3
If (Sheet1.Cells(4, x).Value = PairVals(0, j)) Then 'No change
Else 'link val changed
mRow = Cells(4, x).End(xlDown).Row
Sheet1.Cells(mRow + 1, x) = PairVals(0, j)
Sheet1.Cells(mRow + 1, (x + 1)) = PairVals(1, j)
Sheet1.Cells(mRow + 1, (x + 2)) = Date & " " & Time
PairVals(0, j) = Sheet1.Cells(4, x).Value
PairVals(1, j) = Sheet1.Cells(4, (x + 1)).Value
End If
j = j + 1
Next x
Else 'Off
End If
End Sub
----------------------------------------------------------------------
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
End Sub
------------------------------------------------------------------------
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
End Sub
Bookmarks