Bonsoir,
voici une proposition :
Sub Résultat()
lni = 8
coli = 3
Set fr = Sheets("Résultats")
For i = 7 To 12
fr.Cells.Borders(i).LineStyle = xlNone
Next i
For ln = 7 To Range("C" & Rows.Count).End(xlUp).Row
lnD = lni
lnf = lni + Range("D" & ln) - 1
colf = coli + Range("E" & ln) - 1
fr.Range(fr.Cells(lnD, coli), fr.Cells(lnf, colf)).BorderAround Weight:=xlThin
ActiveWorkbook.Names.Add Name:=Range("C" & ln), RefersTo:= _
fr.Range(fr.Cells(lnD, coli), fr.Cells(lnf, colf))
fr.Cells(lnD, coli).Offset(1, 1).Value = Range("C" & ln)
fr.Cells(lnD, coli).FormulaR1C1 = "=IF(ISBLANK(R[1]C),RC1)"
fr.Cells(lnD, colf).FormulaR1C1 = "=IF(R[1]C="""",R241C)"
fr.Cells(lnf, coli).FormulaR1C1 = "=IF(ISBLANK(R[-1]C),R241C,"""")"
fr.Cells(lnf, colf).FormulaR1C1 = "=IF(R[-1]C="""",RC1,"""")"
lni = lni + Range("D" & ln) + 1
Next ln
fr.Activate
Range("A1").Select
End Sub
En fait avec ce système il ne faut pas d'espace dans le nom... Alors il faut modifier le nom des rectangles en ajoutant un Under score "_"
C'est tout ce que j'ai à vous proposer
@bientôt
LouReeD