Bonjour tout le monde.
Je suis novice en VBA mais je cherche à me perfectionner.
Mon problème est le suivant. Je souhaite copier certaines cellules d'un classeur dans d'autres cellules dans un autre classeur.
Par exemple :
Recopie les cellules B1, D1, E1 dans un classeur dans les cellules respectivement A1,B1,C1 puis enregistrer le document en lui donnant un nom.
Voici ci-dessous mon code :
Dim wkDest As Workbook
Dim Tablo
'******Recopie classeur --> classeur
Set wkDest_1 = Application.Workbooks.Open("C:\Users\baptiste.moulin\Desktop\BS CABLE\Test\SIGNAL CABLE TEST SHEET.xlsx")
'ThisWorkbook.Sheets("MCC - INS - CABLES").Range("B16:B18").Copy wkDest.Sheets("Feuil1").Range("A1")
'wkDest.Close True
'***** tant que cellule pleine recopie
'Application.ScreenUpdating = False
With ThisWorkbook.Sheets("MCC - INS - CABLES")
Num_Doc = .Range(.Cells(16, 4), .Cells(.Cells(.Rows.Count, 1).End(xlUp).Row, 4))
Tag = .Range(.Cells(16, 2), .Cells(.Cells(.Rows.Count, 1).End(xlUp).Row, 2))
Brins = .Range(.Cells(16, 6), .Cells(.Cells(.Rows.Count, 1).End(xlUp).Row, 6))
Section = .Range(.Cells(16, 7), .Cells(.Cells(.Rows.Count, 1).End(xlUp).Row, 7))
Type_Cab = .Range(.Cells(16, 5), .Cells(.Cells(.Rows.Count, 5).End(xlUp).Row, 5))
End With
With wkDest_1.Sheets("Feuil1")
For i = LBound([Num_Doc:Tag], 1) To UBound([Num_Doc:Tag], 1)
For j = LBound([Num_Doc:Tag], 2) To UBound([Num_Doc:Tag], 2)
If Tablo(i, j) <> "" Then .Cells(i, j) = [Num_Doc:Tag](i, j)
Next j
Next i
End With
Je tiens à préciser qu'avant j'arrivais à copier une colonne vers l'autre classeur
Merci de votre aide.