Formatting a simple cell
Posted: Tue Oct 29, 2013 2:01 pm
Hello,
I'm trying to change the font color of one cell to red. I have given up trying to do it with Cell[y,x].fontcolor : I don't know how to specify the color and it messed up my original XLS file.
So I'm now trying, using the example and "Default" formats (I guess this horror is due to Excel's file format) :
Now how do I apply this default F3 (why F3 ?) to one cell ?
And what if I reopen the same xls file and want to apply the same red/bold to another cell ? Do I have to first search in the stored formats if one suits my needs then reuse it or create a new one ?
Is there a documentation somewhere explaining this ? All I found was a reference manual in html and the SampleFormatCells example. None of these 2 explain the concept. What did I miss ?
Thanks,
I'm trying to change the font color of one cell to red. I have given up trying to do it with Cell[y,x].fontcolor : I don't know how to specify the color and it messed up my original XLS file.
So I'm now trying, using the example and "Default" formats (I guess this horror is due to Excel's file format) :
Code: Select all
XLS.CmdFormat.BeginEdit(Nil);
XLS.CmdFormat.Font.Color.IndexColor:=xcDarkRed;
XLS.CmdFormat.Font.Style := [xfsBold];
fmt:=XLS.CmdFormat.AddAsDefault('F3');
And what if I reopen the same xls file and want to apply the same red/bold to another cell ? Do I have to first search in the stored formats if one suits my needs then reuse it or create a new one ?
Is there a documentation somewhere explaining this ? All I found was a reference manual in html and the SampleFormatCells example. None of these 2 explain the concept. What did I miss ?
Thanks,