Pbe ajustement cellule

LaurentG

XLDnaute Occasionnel
Bonjour,

J'ai un petit soucis d'ajustement de cellule.
J'ai dans une cellule plusieurs lignes.

Exemple:
Lundi
Mardi
Mercredi

Mais la cellule ne s'ajuste pas en hauteur (Précision : mes cellules A à H sont fusionnées.)

Quelqu'un a une idée sur la question?

Merci beaucoup

Laurent
 

LaurentG

XLDnaute Occasionnel
En fouillant un petit peu plus sur le forum j'ai trouvé mon bonheur.

pour info, j'ai utilisé le code suivant :

Code:
Dim CurrentRowHeight As Single, MergedCellRgWidth As Single
Dim CurrCell As Range
Dim ActiveCellWidth As Single, PossNewRowHeight As Single
  
  If ActiveCell.MergeCells Then
    With ActiveCell.MergeArea
      .WrapText = True 'enclenche le renvoi à la ligne automatique (modif fs)
      If .Rows.Count = 1 Then 'And .WrapText = True Then
        Application.ScreenUpdating = False
        CurrentRowHeight = .RowHeight
        ActiveCellWidth = ActiveCell.ColumnWidth
        For Each CurrCell In Selection
          MergedCellRgWidth = CurrCell.ColumnWidth + MergedCellRgWidth
        Next
       .MergeCells = False
       .Cells(1).ColumnWidth = MergedCellRgWidth
       .EntireRow.AutoFit
        PossNewRowHeight = .RowHeight
       .Cells(1).ColumnWidth = ActiveCellWidth
       .MergeCells = True
       .RowHeight = IIf(CurrentRowHeight > PossNewRowHeight, _
         CurrentRowHeight, PossNewRowHeight)
      End If
    End With
  End If

Merci

Laurent
 

Discussions similaires

Réponses
17
Affichages
761

Statistiques des forums

Discussions
312 519
Messages
2 089 247
Membres
104 079
dernier inscrit
zaqichan