Option Explicit
Sub flat(r_from As Range, r_dest As Range)
Dim cella As Range, first_found As String, i As Integer, x As String
With r_from
Set cella = .Find("x")
If Not (cella Is Nothing) Then
first_found = cella.Address
Do
r_dest.Offset(i) = r_from(1, cella.Column - r_from.Column + 1) 'lettera di riga
r_dest.Offset(i, 1) = r_from(cella.Row - r_from.Row + 1, 1) 'numero di colonna
i = i + 1
Set cella = .FindNext(cella)
Loop While Not cella Is Nothing And cella.Address <> first_found
End If
End With
End Sub |