Sub dividi_e_copia()
Dim rng As Range, cella As Range
Dim i As Integer, x As Integer
'converto tutte le celle in valori (non necessario)
With Cells
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False
Set rng = Range("A1").CurrentRegion
'per ogni cella della tabella
For Each cella In rng
'determino quante celle sono unite
x = cella.MergeArea.Count
'se la cella è unita allora...
If cella.MergeCells = True Then
'divido
cella.UnMerge
For i = 1 To x - 1
'ripoto il valore su tutte le celle divise
cella.Offset(0, i) = cella.Value
Next i
End If
Next cella
End Sub
|