 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Daryl Guest
|
Posted: Fri May 18, 2007 2:36 am Post subject: Changing the colour of a Excel cell's font, not using a Rang |
|
|
Hi
Is there any way to change the attributes of a cells font without using is
'range' or the cell being the 'activecell'?
My problem is that I am filling a worksheet using the contents of a string
grid, this works fine, I would now like to change the colour of some
selected cells during this loading process. If I have to use Range (which
are the only examples I have seen) to do this then I have to know what
character to append to the row and column i.e. WS.Range[F1, F1].Font.Color
:= clRed; . I am using WS.Cells.Item[Row, Col].Value := 'My Value'; to add
the value in the loop.
Ideally, I would like to use the Row and Col values to access the cell I
want to change the font's attributes.
Any help would be good.
thanks
daryl |
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Fri May 18, 2007 1:11 pm Post subject: Re: Changing the colour of a Excel cell's font, not using a |
|
|
Can't you just say selection.font.color:=clRed?
Oliver Townshend |
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Sat May 19, 2007 1:02 am Post subject: Re: Changing the colour of a Excel cell's font, not using a |
|
|
Use the next syntax:
WS.Cells.Item[Row, Col].Font.Color := ColorToRGB(yourColor)
WS.Cells.Item[Row, Col].Font.Interior.Color :=
ColorToRGB(yourBackgroundColor);
--
With best regards, Mike Shkolnik
Scalabium Software
http://www.scalabium.com
mshkolnik (AT) scalabium (DOT) com
"Daryl" <devaccount (AT) hotmail (DOT) com> wrote in message
news:464ccadc (AT) newsgroups (DOT) borland.com...
| Quote: | Hi
Is there any way to change the attributes of a cells font without using is
'range' or the cell being the 'activecell'?
My problem is that I am filling a worksheet using the contents of a string
grid, this works fine, I would now like to change the colour of some
selected cells during this loading process. If I have to use Range (which
are the only examples I have seen) to do this then I have to know what
character to append to the row and column i.e. WS.Range[F1, F1].Font.Color
:= clRed; . I am using WS.Cells.Item[Row, Col].Value := 'My Value'; to add
the value in the loop.
Ideally, I would like to use the Row and Col values to access the cell I
want to change the font's attributes.
Any help would be good.
thanks
daryl
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|