Je viens de tester, en effet, ça ne passe pas.
Alors voici une première solution, avec la colonne A de destination au format texte :
Sub test()
with thisworkbook.sheets(1).range("A:A")
.numberformat = "@"
For Each ws In Workbooks("test2.xlsx").Worksheets
dl = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row
t = ws.Columns(1).Resize(dl).Value
nvl = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(nvl, 1).Resize(UBound(t)).Value = t
Next ws
On Error Resume Next
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
end with
End Sub
Sinon, en voici une seconde avec transformation des valeurs à 5 chiffres :
Sub test()
with thisworkbook.sheets(1).range("A:A")
For Each ws In Workbooks("test2.xlsx").Worksheets
dl = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row
t = CText(ws.Columns(1).Resize(dl).Value)
nvl = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(nvl, 1).Resize(UBound(t)).Value = t
Next ws
On Error Resume Next
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
end with
End Sub
function CText(ArrSrc)
for i = lbound(ArrSrc) to ubound(ArrSrc)
if ArrSrc(i, 1) like "#####" then ArrSrc(i, 1) = "'" & ArrSrc(i, 1)
next i
CText = ArrSrc
end function
La première est plus simple et évite toute confusion puisque le format est homogène.
Cdlt,