Copier la colonne par son nom à une autre colonne

Sub Bouton5_Cliquer()

Dim strF As String, strP As String

Dim wb As Workbook

Dim ws As Worksheet

Dim dest As Workbook

'Edit this declaration to your folder name

strP = "C:\Users\Documents\" 'change for the path of your folder

'Change as require

strF = Dir(strP & "\test*.xlsm")

Do While strF <> vbNullString

Set wb = Workbooks.Open(strP & "\" & strF)

Set ws = wb.Sheets("name") 'uses first sheet or if all the same names then ws.Sheets("yoursheet")

Bonjour à tous,

J"ai besoin de votre aide je cherche une macro pour concatener 2 colonne dans une colonne, dans la même feuil, mais la recherche s'effectue à partir du nom de la colonne ou range, voici le code que je suis entrain de chercher et modifier mais ça marche pas :

With ws

Set colh = .Range("1:1").Find("name")

cnt = Cells(Rows.Count, colh.Column).End(xlUp).Row

MsgBox cnt

wb.Resize(cnt).Value = colh.Offset(3).Resize(cnt).Value

Set colh = .Range("1:1").Find("number")

ws.Offset(, 3).Resize(cnt).Value = colh.Offset(1).Resize(cnt).Value

End With

' Get next file to Import

wb.Close True

strF = Dir()

Loop

End Sub

merci d'avance

J'ai trouvé la solution si cela peut servir quelqu'un:

Dim rng1 As Range

Dim rng2 As Range

Set rng1 = Sheets("Feuil1").Rows(1).Find("data")

Set rng2 = Sheets("Feuil1").Rows(1).Find("dest")

If rng1 Is Nothing Then

MsgBox "Goods does not exists on Sheet2", vbInformation, "Goods not found"

Else

Set rng1 = Range(rng1.Offset(1), rng1.Offset(Rows.Count - 1).End(xlUp))

rng1.Copy Destination:=rng2.End(xlUp).Offset(1)

End If

Bonne journée

Rechercher des sujets similaires à "copier colonne nom"