Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Servers
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 04-06-2003
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Poder: 10
marcoszorrilla Va por buen camino
Aquí tienes una parte de un ejemplo que tengo por aquí a mano:

Código:
procedure TfmMain.btExample2Click(Sender: TObject);
var
 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;
end;
Un Saludo.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 18:05:30.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi