XL 2013 Problem Vba

Guismo33

XLDnaute Occasionnel
Bonjour a tous,

j'ai un debogage avec cet Vba

Sub somme()
Dim i As Integer
Dim j As Integer
For i = 1 To 11
For j = 1 To 3
Cells(5 + i, 26 + j).Value = Cells(5 + i, 26 + j).Value + Cells(5 + i, 22 + j).Value

Next j
Next i
End Sub

j'ai 4 colonne sur 11 lignes, si il ont un montant
je garde le montant des 4 autres colonnes et 11 lignes +celle-ci

merci a vous tous
 

gilbert_RGI

XLDnaute Barbatruc
Re : Problem Vba

Bonjour,

un petit fichier exemple ce serait bien pratique pour aider non !!!!!

VB:
Sub somme()
    Dim i As Integer
    Dim j As Integer
    With Sheets(1) ' indiquer le num de la feuille de travail
    For i = 1 To 11 ' 11 lignes
        For j = 1 To 4 '4 colonnes et pourquoi trois
            Cells(5 + i, 26 + j).Value = Cells(5 + i, 26 + j).Value + Cells(5 + i, 22 + j).Value

        Next j
    Next i
    End With
End Sub
 
Dernière édition:

Discussions similaires

Statistiques des forums

Discussions
314 223
Messages
2 107 498
Membres
109 844
dernier inscrit
odyn