怎样将excel的某一行设置为蓝色?
解决方案 »
- 这个想法不知道能不能实现?function问题...
- 大家来帮帮忙忙,有谁知道delphi里如何用程序控制传真机?
- 100分求Ras.pass,有关拨号的资料!
- 初学JAVA,JDK环境设置搞不定,救命!
- 有人跨表使用过update吗,
- **100分求clientdataset提交判断问题***help!!!
- 高手请进,怎样改变文件的字体类型????急急急急急!!!!
- 十万火急,如何使用d6盘上的installshield打包?
- 高手們過來討論討論 一個3層結構的程序書寫風格的問題??
- 怎样实现类似OUTLOOK EXPRESS中接收或发送邮件列表的功能?
- 一个初中生的问题!!!!?????????
- 源文件,修改??
qzw1:=excelworksheet2.Range['A2','a1'];
qzw1.Interior.ColorIndex:=3;
WorkBook,Sheet,Cell: Variant;
Col,iRow,Row : Integer;
cl:integer;
s:string;
begin
WorkBook:=Excel.WorkBooks.Add;
Sheet:=WorkBook.WorkSheets[1];
Sheet.Name:='Colors';
Row:=1;
Sheet.Cells[Row,1]:='Red';
Sheet.Cells[Row,2]:='Green';
Sheet.Cells[Row,3]:='Blue';
Sheet.Cells[Row,4]:='Color Sum';
Sheet.Rows[Row].Font.Bold:=true;
for iRow:=0 to 8 do begin
Row:=iRow+2;
if iRow<8 then cl:=iRow*32 else cl:=$FF;
for Col:=1 to 3 do begin
Cell:=Sheet.Cells[Row,Col];
Cell.Value:=cl;
if Col=1 then Cell.Font.Color:=cl//red
else if Col=2 then Cell.Font.Color:=cl*256//green
else Cell.Font.Color:=cl*256*256;//blue
end;
Cell:=Sheet.Cells[Row,4];
s:=format('=A%d+256*B%d+256*256*C%d',[Row,Row,Row]);
Cell.Formula:=s;
Cell.Font.Color:=Cell.Value;
end;
Sheet.Cells.Columns.AutoFit;
WorkBook,Sheet,Cell: Variant;
iRow,Row : Integer;
NPaletteColors:integer;
begin
WorkBook:=Excel.WorkBooks.Add;
Sheet:=WorkBook.WorkSheets[1];
Sheet.Name:='Palette';
Row:=1;
Sheet.Cells[Row,1]:='Index';
Sheet.Cells[Row,2]:='Color';
Sheet.Cells[Row,3]:='RGB';
Sheet.Rows[Row].Font.Bold:=true;
NPaletteColors:=56;{WorkBook.Colors;}
for iRow:=1 to NPaletteColors do begin
Row:=iRow+2;
Cell:=Sheet.Cells[Row,1];
Cell.Value:=iRow;
Cell:=Sheet.Cells[Row,2];
Cell.Interior.ColorIndex:=iRow;
Sheet.Cells[Row,3]:='0x'+inttohex(WorkBook.Colors[iRow],6);
end;
Sheet.Cells.Columns.AutoFit;
WorkBook,Sheet,Cell: Variant;
Col,iRow,Row : Integer;
cl:integer;
s:string;
begin
WorkBook:=Excel.WorkBooks.Add;
Sheet:=WorkBook.WorkSheets[1];
Sheet.Name:='Colors';
Row:=1;
Sheet.Cells[Row,1]:='Red';
Sheet.Cells[Row,2]:='Green';
Sheet.Cells[Row,3]:='Blue';
Sheet.Cells[Row,4]:='Color Sum';
Sheet.Rows[Row].Font.Bold:=true;
for iRow:=0 to 8 do begin
Row:=iRow+2;
if iRow<8 then cl:=iRow*32 else cl:=$FF;
for Col:=1 to 3 do begin
Cell:=Sheet.Cells[Row,Col];
Cell.Value:=cl;
if Col=1 then Cell.Font.Color:=cl//red
else if Col=2 then Cell.Font.Color:=cl*256//green
else Cell.Font.Color:=cl*256*256;//blue
end;
Cell:=Sheet.Cells[Row,4];
s:=format('=A%d+256*B%d+256*256*C%d',[Row,Row,Row]);
Cell.Formula:=s;
Cell.Font.Color:=Cell.Value;
end;
Sheet.Cells.Columns.AutoFit;