Results 1 to 33 of 33

[SOLVED TY] Type mismatch using array and DDL

Threaded View

futurespec [SOLVED TY] Type mismatch... 07-02-2012, 01:23 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 02:45 AM
futurespec Re: Type mismatch using array... 07-02-2012, 03:08 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 03:17 AM
futurespec Re: Type mismatch using array... 07-02-2012, 03:22 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 03:28 AM
futurespec Re: Type mismatch using array... 07-02-2012, 03:47 AM
futurespec Re: Type mismatch using array... 07-02-2012, 03:53 AM
futurespec Re: Type mismatch using array... 07-02-2012, 04:02 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 04:17 AM
futurespec Re: Type mismatch using array... 07-02-2012, 04:23 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 04:45 AM
futurespec Re: Type mismatch using array... 07-02-2012, 04:55 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 06:10 AM
futurespec Re: Type mismatch using array... 07-02-2012, 07:07 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 07:14 AM
futurespec Re: Type mismatch using array... 07-02-2012, 07:24 AM
futurespec Re: Type mismatch using array... 07-02-2012, 07:27 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 07:37 AM
futurespec Re: Type mismatch using array... 07-02-2012, 07:48 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 08:00 AM
futurespec Re: Type mismatch using array... 07-02-2012, 08:05 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 08:09 AM
futurespec Re: Type mismatch using array... 07-02-2012, 08:16 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 08:23 AM
futurespec Re: Type mismatch using array... 07-02-2012, 08:39 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 08:44 AM
futurespec Re: Type mismatch using array... 07-02-2012, 08:59 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 09:10 AM
futurespec Re: Type mismatch using array... 07-02-2012, 09:16 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 09:19 AM
futurespec Re: Type mismatch using array... 07-02-2012, 09:28 AM
romperstomper Re: Type mismatch using array... 07-02-2012, 09:34 AM
  1. #1
    Registered User
    Join Date
    07-02-2012
    Location
    Northampton
    MS-Off Ver
    Excel 2007
    Posts
    24

    [SOLVED TY] Type mismatch using array and DDL

    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
    Last edited by futurespec; 07-02-2012 at 09:45 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1