Une fonction (récupérée sur le net) à placer dans un module VBA : Alt - F11 puis Insertion > Module et y coller :
Function ConCat(Delimiter As Variant, ParamArray CellRanges() As Variant) As String
Dim Cell As Range, Area As Variant
If IsMissing(Delimiter) Then Delimiter = ""
For Each Area In CellRanges
If TypeName(Area) = "Range" Then
For Each Cell In Area
If Len(Cell.Value) Then ConCat = ConCat & Delimiter & Cell.Value
Next
Else
ConCat = ConCat & Delimiter & Area
End If
Next
ConCat = Mid(ConCat, Len(Delimiter) + 1)
End Function
Le premier paramètre est le délimiteur, il est possible de spécifier plusieurs plages de cellules à la suite.
Il est nécessaire d'enregistrer le fichier en xlsm pour conserver la macro. Pour l'utiliser, en C1 saisir :
=concat(" ";D1:QX1)