Function tutu(Plage As Range, Optional typ As XlSpecialCellsValue = xlLogical + xlNumbers)
'
'¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯'
' 4 Fructidor CCXX (escourgeon) ROGER2327 fecit. '
'____________________________________________________'
'
Dim kc%, k1%, k2%, tf As Boolean, vc(), v1(), v2(), Colonne As Range, Plage1 As Range, Plage2 As Range, Col As Range
With Plage
'
'=== Facultatif : ===
' On Error Resume Next
' Set Col = .SpecialCells(xlCellTypeConstants, typ)
' On Error GoTo 0
' If Col Is Nothing Then Beep Else Col.Select
'====================
'
ReDim v1(1 To .Areas.Count)
For Each Plage1 In .Areas
tf = False
ReDim vc(1 To Plage1.Columns.Count)
kc = 0
For Each Colonne In Plage1.Columns
On Error Resume Next
Set Col = Intersect(Colonne, Colonne.SpecialCells(xlCellTypeConstants, typ))
On Error GoTo 0
If Col Is Nothing Then
If UBound(vc) > 1 Then ReDim Preserve vc(1 To UBound(vc) - 1)
Else
kc = kc + 1
tf = True
If Col.Count = 1 Then
vc(kc) = Col.Value
Else
ReDim v2(1 To Col.Areas.Count)
k2 = 0
For Each Plage2 In Col.Areas
k2 = k2 + 1
If Plage2.Count = 1 Then
v2(k2) = Plage2.Value
Else
v2(k2) = Join(WorksheetFunction.Transpose(Plage2.SpecialCells(xlCellTypeConstants, typ).Value), ";")
End If
Next
vc(kc) = Join(v2, ";")
End If
Set Col = Nothing
End If
Next
If tf Then k1 = k1 + 1: v1(k1) = Join(vc, ";") Else If UBound(v1) > 1 Then ReDim Preserve v1(1 To UBound(v1) - 1)
Next
End With
tutu = Join(v1, ";")
End Function