Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Hauteur de ligne et largeur de colonne

2 réponses
Avatar
Albator V
j'ai trouve la macro suivante

Sub CopierLigCol()
Col = Selection.Columns.Count
Li = Selection.Rows.Count
xcol = ActiveCell.Column - 1
xli = ActiveCell.Row - 1
ReDim Plage(Col, Li, 1) As Long
For Each Cell In Selection
Plage(Cell.Column - xcol, Cell.Row - xli, 0) =
Cell.ColumnWidth
Plage(Cell.Column - xcol, Cell.Row - xli, 1) =
Cell.RowHeight
Next
Selection.Copy
End Sub

Sub CollerLigCol()
Application.ScreenUpdating = False
ActiveSheet.Paste
ActiveCell.Select
Debut = ActiveCell.Address
xcol = 1
xli = 1
For xcol = 1 To Col
ActiveCell.ColumnWidth = Plage(xcol, 1, 0)
ActiveCell.Offset(0, 1).Range("A1").Select
Next
For xli = 1 To Li
ActiveCell.RowHeight = Plage(1, xli, 1)
ActiveCell.Offset(1, 0).Range("A1").Select
Fin = ActiveCell.Offset(-1, -1).Range("A1").Address
Next
Range(Debut, Fin).Select
Application.ScreenUpdating = True
End Sub

maintenant il y a un leger probleme... les valeurs
(hauteur et largeur) sont arrondis a l'unite...

est il possible de mettre en memoire des valeurs
decimales dans une plage ?

2 réponses

Avatar
Albator V
deja je mexcuse... jai ouvert un post hier a ce sujet et
j'ai appuier sur nouveau message au lieu de repondre...

sinon jai change as long par as variant et ca marche...

c'est la bonne solution ??

-----Message d'origine-----
j'ai trouve la macro suivante

Sub CopierLigCol()
Col = Selection.Columns.Count
Li = Selection.Rows.Count
xcol = ActiveCell.Column - 1
xli = ActiveCell.Row - 1
ReDim Plage(Col, Li, 1) As Long
For Each Cell In Selection
Plage(Cell.Column - xcol, Cell.Row - xli, 0) =
Cell.ColumnWidth
Plage(Cell.Column - xcol, Cell.Row - xli, 1) =
Cell.RowHeight
Next
Selection.Copy
End Sub

Sub CollerLigCol()
Application.ScreenUpdating = False
ActiveSheet.Paste
ActiveCell.Select
Debut = ActiveCell.Address
xcol = 1
xli = 1
For xcol = 1 To Col
ActiveCell.ColumnWidth = Plage(xcol, 1, 0)
ActiveCell.Offset(0, 1).Range("A1").Select
Next
For xli = 1 To Li
ActiveCell.RowHeight = Plage(1, xli, 1)
ActiveCell.Offset(1, 0).Range("A1").Select
Fin = ActiveCell.Offset(-1, -1).Range("A1").Address
Next
Range(Debut, Fin).Select
Application.ScreenUpdating = True
End Sub

maintenant il y a un leger probleme... les valeurs
(hauteur et largeur) sont arrondis a l'unite...

est il possible de mettre en memoire des valeurs
decimales dans une plage ?
.



Avatar
michdenis
Bonjour Albartor V,

As Double ... aurait êté suffisant !


Salutations!



"Albator V" a écrit dans le message de news:
63b001c4cc90$a7f78530$
deja je mexcuse... jai ouvert un post hier a ce sujet et
j'ai appuier sur nouveau message au lieu de repondre...

sinon jai change as long par as variant et ca marche...

c'est la bonne solution ??

-----Message d'origine-----
j'ai trouve la macro suivante

Sub CopierLigCol()
Col = Selection.Columns.Count
Li = Selection.Rows.Count
xcol = ActiveCell.Column - 1
xli = ActiveCell.Row - 1
ReDim Plage(Col, Li, 1) As Long
For Each Cell In Selection
Plage(Cell.Column - xcol, Cell.Row - xli, 0) >Cell.ColumnWidth
Plage(Cell.Column - xcol, Cell.Row - xli, 1) >Cell.RowHeight
Next
Selection.Copy
End Sub

Sub CollerLigCol()
Application.ScreenUpdating = False
ActiveSheet.Paste
ActiveCell.Select
Debut = ActiveCell.Address
xcol = 1
xli = 1
For xcol = 1 To Col
ActiveCell.ColumnWidth = Plage(xcol, 1, 0)
ActiveCell.Offset(0, 1).Range("A1").Select
Next
For xli = 1 To Li
ActiveCell.RowHeight = Plage(1, xli, 1)
ActiveCell.Offset(1, 0).Range("A1").Select
Fin = ActiveCell.Offset(-1, -1).Range("A1").Address
Next
Range(Debut, Fin).Select
Application.ScreenUpdating = True
End Sub

maintenant il y a un leger probleme... les valeurs
(hauteur et largeur) sont arrondis a l'unite...

est il possible de mettre en memoire des valeurs
decimales dans une plage ?
.