Error 13 Type Mismatch VBA Excel

Solved
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

2 réponses

f894009 Posted messages 17417 Registration date   Status Membre Last intervention   1 717
 
Hello,

The name of the Excel sheet must be in double quotes: e.g.--->"Sheet1"

Have a good continuation
1