Sub TBoxMove(k)
With ActiveSheet.DrawingObjects(1)
.Formula = "=" & [Nom].Address
.Top = Cells(1).Top
.Left = Cells(1, k + 2).Left
.Height = Cells(1).Height * [Nom].Rows.Count
.Width = 100
End With
Exit Sub
End Sub
Sub TBoxMove(k)
With ActiveSheet.DrawingObjects(1)
.Formula = "=" & [Nom].Address
.Top = Cells(1).Top
.Left = Cells(1, k + 2).Left
.Height = Cells(1).Height * [Nom].Rows.Count
'-------ajustement = largeur (pixels) de la colonne B
.Width = [C1].Left - [B1].Left
End With
Exit Sub
End Sub
????En règle générale aucune ne résiste à la réinitialisation. (s'il ne reste que B1)
Modeste : ne s'étend plus en hauteur et ne diminue plus non plus.
J'avais en effet remarqué qu'on ne peut fixer à la fois la hauteur et la largeur car le respect des proportions posait problème.
Sub TBoxMove(k)
With ActiveSheet.DrawingObjects(1)
.ShapeRange.LockAspectRatio = msoFalse ' <<<<<< !!!
.Formula = "=" & [Nom].Address
.Top = Cells(1).Top
.Left = Cells(1, k + 2).Left
.Height = [Nom].Height
'-------ajustement = largeur (pixels) de la colonne B
.Width = [C1].Left - [B1].Left
End With
Exit Sub
End Sub
.ShapeRange.LockAspectRatio = msoFalse