XL 2019 Comment faire a vba ?

frederio

XLDnaute Impliqué
Bonjour à tous
Tu vous connais comment faire ?
Si tu veux être d’accord avec moi ??? vous m’aidez a expliqué comme Excel Merci

Comment faire a vba ?

  • Faire effacer B5: B22
  • Faire copie D5: D22
  • Faire coller B5: B22
 

Pièces jointes

  • Belgique.xlsm
    726.5 KB · Affichages: 11

laurent950

XLDnaute Accro
Bonjour,

VB:
Sub CopieColler()
Dim Rgn() As Variant
ReDim Rgn(0 To 2)
    Set Rgn(0) = Range(Cells(5, 2), Cells(22, 2)) 'B5:B22
        Rgn(1) = Range(Cells(5, 4), Cells(22, 4)) 'D5:D22
    Set Rgn(2) = Range(Cells(5, 4), Cells(22, 4)) 'D5:D22
        Rgn(0).ClearContents
        Rgn(2).ClearContents
        Rgn(0).Value = Rgn(1)
End Sub
 

frederio

XLDnaute Impliqué
comment enlever ( 0 )
2023-05-13_16-34-44.jpg
 

laurent950

XLDnaute Accro
Bonjour,

HTML:
Sub CopieColler()
Dim Rgn() As Variant
ReDim Rgn(0 To 3)
    Set Rgn(0) = Range(Cells(5, 2), Cells(22, 2)) 'B5:B22
        Rgn(1) = Range(Cells(5, 4), Cells(22, 4)) 'D5:D22
    Set Rgn(2) = Range(Cells(5, 4), Cells(22, 4)) 'D5:D22
    Set Rgn(3) = Range(Cells(5, 12), Cells(22, 12)) 'L5:L22
        Rgn(0).ClearContents
        Rgn(2).ClearContents: Rgn(3).NumberFormat = ";;;"
        Rgn(0).Value = Rgn(1)
End Sub
 

Statistiques des forums

Discussions
312 215
Messages
2 086 330
Membres
103 187
dernier inscrit
ebenhamel