I've written this code to find squared Range spoted with a back ground color.
My problem is that it thakes 4 or 5 seconds to execute on a large range of 36000 row x 8 columns.
Do you have suggestions to improve and speed the code quoted below ?
Function RegionColoree(cel As Range)
i = 0
ii = 0
j = 0
jj = 0
Set cel = cel.Resize(1, 1)
If Not cel.Interior.ColorIndex = xlNone Then
Do While cel.Offset(i).Interior.ColorIndex <> xlNone 'vers le bas
i = i + 1
Loop
Do While cel.Offset(ii).Interior.ColorIndex <> xlNone 'vers le haut
ii = ii - 1
Loop
Do While cel.Offset(, j).Interior.ColorIndex <> xlNone 'vers la droite
j = j + 1
Loop
Do While cel.Offset(, jj).Interior.ColorIndex <> xlNone 'vers la gauche
jj = jj - 1
Loop
ii = ii + 1
jj = jj + 1
RegionColoree = cel.Offset(ii, jj).Resize(i - ii, j - jj).Address
End If
End Function