essaye de modifier ma macro, elle devrait te convenir et en plus elle
est simple :
REM ***** BASIC *****
sub Main
document= ThisComponent.getCurrentController()
ocontroller = ThisComponent
osheet=ThisComponent.sheets.getbyname("feuille2")
document.SetActiveSheet(osheet)
osheet=ocontroller.Sheets
ocellrange=ocontroller.currentSelection
tdata=ocellrange.dataarray
for cptline=Lbound(tdata) to Ubound(tdata)
for cptrow=Lbound(tdata(curline)) to Ubound(tdata(cptline))
tTmp=tdata(cptline)
oval=tTmp(cptrow)
ocell = ocellrange.getcellbyposition(cptrow,cptline)
ocell.cellstyle="Standard"
if oval = "lundi" or "Lundi" or "LUNDI" then
ocell.cellstyle="rouge"
else
if oval= "mardi" or "Mardi" or "MARDI" then
ocell.cellstyle="bleu"
else
if oval= "mercredi" or "Mercredi" or "MERCREDI" then
ocell.cellstyle="vert"
else
if oval= "jeudi" or "Jeudi" or "JEUDI" then
ocell.cellstyle="jaune"
else
if oval= "vendredi" or "Vendredi" or "VENDREDI" then
ocell.cellstyle="orange"
else
ocell.cellstyle="Standard"
end if
end if
end if
end if
end if
next cptrow
next cptline
end sub
Pierre Piteau a écrit :
Bonjour Nicolas
Je souhaite dans une cellule mettre des conditions "SI", jusque là,
pas de problème. J'aimerais que le résultat s'affiche sous la forme
d'une couleur différente.
SI(A=1,"Affiché en rouge","Affiché en vert")
Voilà,
A savoir que j'ai plus de trois conditions (en fait j'en ai 6).
Voir dans l'aide la fonction STYLE qui pourrait t'aider à résoudre ton
problème
Cordialement
Pierre
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]