Results 1 to 4 of 4

type mismatch 13 in excel 2010

Threaded View

  1. #1
    Registered User
    Join Date
    12-02-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2003
    Posts
    8

    type mismatch 13 in excel 2010

    The following code worked perfectly under excel 2003, but in 2010 returns error 'type mismatch 13' in the following line "If Array2(1, i) <> 0 Then"

    Anyone has any ideas how to solve this ?

    Thx in advance

    Sonny

    Here is the code:


    Sub BerekenGepresteerdeUrenVoorEenMaand(SheetNaam As String)
    
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    
    Dim Array1 As Variant
    Dim Array2 As Variant
    
    Dim Range1 As Range
    Dim Range2 As Range
    Dim RangeTarget1 As Range
    Dim RangeTarget2 As Range
    Dim mRange As Excel.Range
    Dim RangeNieuwSaldo As Range
    
    Dim i As Integer
    Dim j As Integer
    Dim k As Integer
    Dim l As Integer
    
    Dim subTotaal As Double
    
    ActiveWorkbook.Worksheets(SheetNaam).Activate
    
    Set Range1 = ActiveSheet.Range("EersteRij")
    Set Range2 = ActiveSheet.Range("LaatsteRij")
    Set RangeTarget1 = ActiveSheet.Range("NaamVeld")
    Set RangeTarget2 = ActiveSheet.Range("SaldiVeld")
    
    Array1 = Range1.Value
    Array2 = Range2.Value
    
    RangeTarget1.Locked = False
    RangeTarget2.Locked = False
    
    j = 0
    For i = LBound(Array1, 2) To UBound(Array1, 2)
    
    If Array2(1, i) <> 0 Then 'Line generating error
    
    j = j + 1
    
    RangeTarget1.Cells(j, 1).Value = Array1(1, i)
    RangeTarget2.Cells(j, 1).Value = Array2(1, i)
    
    Else
    
    End If
    
    Next
    
    For k = j + 1 To 11
    
    RangeTarget1.Cells(k, 1).Value = ""
    RangeTarget2.Cells(k, 1).Value = ""
    
    Next
    
    RangeTarget1.Locked = False
    RangeTarget2.Locked = False
    
    Erase Array1
    Erase Array2
    
    Set Range1 = Nothing
    Set Range2 = Nothing
    Set RangeTarget1 = Nothing
    Set RangeTarget2 = Nothing
    
    Application.EnableEvents = True
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    
    
    End Sub

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. I have added code tags for you because you are a new member, see rule #3. --6StringJazzer
    Last edited by desonny; 01-21-2014 at 04:12 PM. Reason: code tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error 13 type mismatch in excel 2010
    By excelbugs_help in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2013, 05:56 AM
  2. Error 13 Type Mismatch in excel VB
    By sid_excelforum in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-27-2013, 06:14 PM
  3. Excel 2010 (Run-time error '13' type mismatch) "Debug" and "Continue" Grayed out.
    By Jeronimo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2012, 06:42 PM
  4. Type mismatch in VBA, excel 2007
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-18-2011, 03:18 PM
  5. type mismatch in 2010
    By Bryn's Dad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2011, 01:07 PM

Tags for this Thread

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