Error 13 Type Mismatch VBA Excel
Solved
monalisach
-
monalisach -
monalisach -
Hello,
here is a code that generates error 13 type mismatch
Private Sub CommandButton1_Click()
Dim b As Integer
Dim somme() As Double
ReDim somme(1 To 300)
For b = 1 To 300
somme(b) = somme(b) + ThisWorkbook.Worksheets(Feuil1).Cells(b, 10)
If Cells(b + 1, 2) = ThisWorkbook.Worksheets(Feuil1).Cells(b, 5) Then
somme(b + 1) = somme(b + 1) + ThisWorkbook.Worksheets(Feuil1).Cells(b + 1, 10)
End If
ThisWorkbook.Worksheets(Feuil1).Cells(b + 1, 15) = somme(b)
Next b
End Sub
thank you for your help.
Configuration: Windows 7 / Internet Explorer 9.0
here is a code that generates error 13 type mismatch
Private Sub CommandButton1_Click()
Dim b As Integer
Dim somme() As Double
ReDim somme(1 To 300)
For b = 1 To 300
somme(b) = somme(b) + ThisWorkbook.Worksheets(Feuil1).Cells(b, 10)
If Cells(b + 1, 2) = ThisWorkbook.Worksheets(Feuil1).Cells(b, 5) Then
somme(b + 1) = somme(b + 1) + ThisWorkbook.Worksheets(Feuil1).Cells(b + 1, 10)
End If
ThisWorkbook.Worksheets(Feuil1).Cells(b + 1, 15) = somme(b)
Next b
End Sub
thank you for your help.
Configuration: Windows 7 / Internet Explorer 9.0