Ciao Salvatore stavo guardando questo codice per fare delle prove sulle le celle unite, vedo che funziona ma se per esempio unisco 6 celle in colonna tipo A1, a2,a3,a4,a5,a6, poi dando l'invio il codice mi apre tutte le 6 celle incolonnate al massimo in altezza.
Chiedo tu sai modificare il codice affinchè me lo allarghi si ma riesca ad adattarsi al testo??
ti ho allegato il file
Magari per te è un gioco da ragazzi ma per me ....😀
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range
OldRwHt = Target.RowHeight
With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
If OldRwHt < NewRwHt Then
ma.RowHeight = NewRwHt
Else
ma.RowHeight = OldRwHt
End If
cWdth = 0: MrgeWdth = 0
Application.ScreenUpdating = True
End If
End With
End Sub