sub FdlColor() dim F as object dim i as integer, j as integer, nbLig as integer, Lig as integer dim Color as long , FColor as long dim Fin as boolean,Empty as integer Fin=false Empty=0 i=0 F = thisComponent.currentController.ActiveSheet while not Fin Color=-1 FColor=-1 select Case F.getCellByPosition(0,i).formula Case "MODATTR" FColor=rgb(40,105,193) Case "DEFAULT" FColor=rgb(40,119,56) Case "END" Color=rgb(234,169,76) FColor=rgb(0,0,0) Case "BEGIN" Color=rgb(234,169,76) FColor=rgb(0,0,0) Case "ATTR" Color=rgb(255,255,255) Color=-1 FColor=rgb(0,0,0) Case "PROFIL" Color=rgb(230,165,228) Case "ACCESS" Color=rgb(247,206,167) Case "ORDER" Color=rgb(250,237,86) Case "//" Color=rgb(247,240,167) end select select Case F.getCellByPosition(6,i).formula Case "frame" Color=rgb(204,255,204) Case "tab" Color=rgb(204,204,255) Case "array" Color=rgb(255,204,153) Case "array(""empty"")" Color=rgb(255,204,153) Case "menu" Color=rgb(230,230,255) end select for j=0 to 15 if (Color < 0) then F.getCellByPosition(j,i).IsCellBackgroundTransparent=true if (Color>=0) then F.getCellByPosition(j,i).CellBackColor=Color if (FColor>=0) then F.getCellByPosition(j,i).CharColor=FColor next j i=i+1 'if (i>10) then Fin=true if (F.getCellByPosition(0,i).formula="") then Empty=Empty+1 else Empty=0 if (Empty > 20) then Fin=true wend end sub