Macro copie

bonjour

ertit souci avec la macro pour copier mes cellules...

au lieu de les copier dans la collone B, je veux les copier dans la meme colonne que la ou elles se trouvent sur pa feuille 2, mais sur la page 1...

voila ma macro :

Sub copie()

Dim lgLig As Long

Dim lgCol As Long

' Boucle de la ligne 5 à 33

For lgLig = 4 To 33

' Boucle de la colonne E à N

For lgCol = 2 To 9

If Cells(lgLig, lgCol) <> "" And Cells(lgLig, lgCol) <> 0 Then

Range("B" & lgLig) = Cells(lgLig, lgCol)

Exit For

End If

Next lgCol

Next lgLig

End Sub

merci

Bonsoir tony13800,

Je ne sais pas si j'ai bien compris ce que tu voulais.

Sub copie()
    Dim lgLig As Long
    Dim lgCol As Long

    With Worksheets("Feuil2")
        ' Boucle de la ligne 4 à 33
        For lgLig = 4 To 33
            ' Boucle de la colonne B à I
            For lgCol = 2 To 9
                If .Cells(lgLig, lgCol) <> "" And .Cells(lgLig, lgCol) <> 0 Then
                    Worksheets("Feuil1").Cells(lgLig, lgCol) = .Cells(lgLig, lgCol)
                    Exit For
                End If
            Next lgCol
        Next lgLig
    End With
End Sub

merci

je vais essayer ca

impec

juste ce que je voulais

merci

Rechercher des sujets similaires à "macro copie"