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