bonjour
je souhaiterias spécifier dans le code ci dessous que la hauteur de la ligne qui s'insère en rouge est de 5
j'essaye d'utiliser "rowheight" mais je galère pour la mettre en place!!!
quelqu'un a t'il une idée? 🙁
merci
Sub Tri_InserLigne()
Application.ScreenUpdating = False
Dim plg As Range, plg2 As Range
Dim i As Long
If Sheets("Relance").Range("A4") = "" Then Exit Sub
With Sheets("Relance")
.Range(.Range("A4"), .Range("A4").SpecialCells(xlLastCell)).Interior.ColorIndex = xlNone
.Range("A4:" & .Range("H65536").End(xlUp).Address).Sort Key1:=.Range("F4"), Header:=xlNo
Set plg = .Range("A4:" & .Range("A65536").End(xlUp).Address)
For i = plg.Row + plg.Count - 1 To plg.Row + 1 Step -1
If Cells(i, 6) <> Cells(i - 1, 6) Then
Cells(i, 6).EntireRow.Insert
Cells(i, 1).Resize(1, 9).Interior.ColorIndex = 3
End If
Next
End With
Application.ScreenUpdating = True
End Sub
je souhaiterias spécifier dans le code ci dessous que la hauteur de la ligne qui s'insère en rouge est de 5
j'essaye d'utiliser "rowheight" mais je galère pour la mettre en place!!!
quelqu'un a t'il une idée? 🙁
merci
Sub Tri_InserLigne()
Application.ScreenUpdating = False
Dim plg As Range, plg2 As Range
Dim i As Long
If Sheets("Relance").Range("A4") = "" Then Exit Sub
With Sheets("Relance")
.Range(.Range("A4"), .Range("A4").SpecialCells(xlLastCell)).Interior.ColorIndex = xlNone
.Range("A4:" & .Range("H65536").End(xlUp).Address).Sort Key1:=.Range("F4"), Header:=xlNo
Set plg = .Range("A4:" & .Range("A65536").End(xlUp).Address)
For i = plg.Row + plg.Count - 1 To plg.Row + 1 Step -1
If Cells(i, 6) <> Cells(i - 1, 6) Then
Cells(i, 6).EntireRow.Insert
Cells(i, 1).Resize(1, 9).Interior.ColorIndex = 3
End If
Next
End With
Application.ScreenUpdating = True
End Sub