Ver Mensaje Individual
  #1  
Antiguo 26-09-2008
LoganFenix LoganFenix is offline
Registrado
 
Registrado: sep 2008
Posts: 3
Reputación: 0
LoganFenix Va por buen camino
formato moneda en excel desde delphi

hola tengo una aplicacion en delphi q consiste en realizar consulta y en base a esa consulta me genera un reporte q es enviado a excel.
mi problema es q con los numeros quiero darles el formato moneda ($456,1254.357)y no de numero(45612543.57) parte de mi codigo para hacer el formato es
Código Delphi [-]
  vCell := Hoja.Range['A'+inttostr(ren)+':' + CHAR(num_columna)+ inttostr(ren)];
    vCell.Borders.LineStyle:= 1;
    vcell.Interior.ColorIndex := 15;
    vcell.HorizontalAlignment := 3;
    vcell.VerticalAlignment := -4160;
    vcell.WrapText := true ;
    vcell.Orientation := 0;
    vcell.AddIndent := False ;
    vcell.IndentLevel := 0 ;
    vcell.ShrinkToFit := False;
    vcell.ReadingOrder := -5002;
    vcell.MergeCells := False;
    vCell.Font.Name:='Arial';
    vCell.Font.Size:=10;
    vCell.font.bold:=true;
    vCell.Value :=XArr;
    ren := 10;
    vCell := Hoja.Range['A'+inttostr(ren)+':' + CHAR(num_columna)+ inttostr(ren)];
    vCell.Borders.LineStyle:= 0; //sin borde
    vcell.Interior.ColorIndex := -4142;//sin relleno
    vcell.HorizontalAlignment := 1; //1 es derecha 3 es centrado 2 es izquierda
    vcell.VerticalAlignment := -4160;
    vcell.WrapText := true ;//permite escribir mas de una linea(la celda)
    vcell.Orientation := 0;
    vcell.AddIndent := False ;
    vcell.IndentLevel := 0 ;
    vcell.ShrinkToFit := False;
    vcell.ReadingOrder := -5002;
    vcell.MergeCells := False;
    vCell.Font.Name:='Arial';
    vCell.Font.Size:=10;
    //vCell.
    vCell.font.bold:=false; //sin negrita
    vCell.Value :=XArr; //CONTIENE TODOS LOS VALORES DE LA LISTA

donde la variable ren=9 se refiere al renglon 9 dar ese formato y ren=10 otro formato
Responder Con Cita