Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.02.25;
Скачать: CL | DM;

Вниз

Работа с Excel-ом   Найти похожие ветки 

 
AleksandrKu   (2004-02-11 15:27) [0]

Как можно выделить ячейку на страничке эксела?
либо изменить шрифт или изменить цвет заливки?


 
clickmaker ©   (2004-02-11 15:34) [1]

Sheet := ExcelApplication.ActiveSheet as _WorkSheet;
Sheet.Range[<диапазон>].Select;
Sheet.Range[<диапазон>].Font := ...


 
AleksandrKu   (2004-02-11 15:39) [2]

Sheet.Range[<диапазон>].Font := ...
<диапазон> как задается? как в самом экселе (D1:f1)?
Шрифт какой можно задать в каком формате?


 
olookin ©   (2004-02-11 15:44) [3]

procedure TEqapExcel.AssignCellFormat(var Value: Variant; CellFormat: TCellFormat);
var V: Variant;
begin
with CellFormat do begin V:=Value.Font; AssignFont(V,Font);
Value.Orientation:=TextRotation; Value.Interior.Pattern:=Pattern;
Value.Interior.PatternColor:=ColorToRGB(PatternColor);
Value.HorizontalAlignment:=xlTextAlignment[integer(HorizTextAlignment)];
Value.VerticalAlignment:=xlTextAlignment[integer(VertTextAlignment)];
Value.ColumnWidth:=Width; Value.RowHeight:=Height; Value.WrapText:=WrapText;
if Color=clNone then Value.Interior.ColorIndex:=xlNone else
Value.Interior.Color:=ColorToRGB(Color); end;
end;

procedure TEqapExcel.AssignFont(var Value: Variant; Font: TFont);
begin
with Font do begin try Value.Name:=Name; Value.Size:=Size;
Value.Bold:=fsBold in Style; Value.Italic:=fsItalic in Style;
Value.Underline:=fsUnderline in Style;
Value.Strikethrough:=fsStrikeOut in Style;
Value.Color:=ColorToRGB(Color);
except on EOleError do end; end;
end;

type TCellFormat = class(TPersistent)
property WrapText: boolean read FWrapText write IsWrapText default false;
property Font: TFont read FFont write SetFont;
property Color: TColor index 1 read FColor write SetColor;
property PatternColor: TColor index 2 read FPatternColor write SetColor;
property Pattern: TPattern read FPattern write SetPattern;
property Width: double index 1 read FWidth write SetValue;
property Height: double index 2 read FHeight write SetValue;
property TextRotation: double index 3 read FRotation write SetValue;
property HorizTextAlignment: TTextAlignment index 1 read FHorizTextAlign
write SetTextAlign;
property VertTextAlignment: TTextAlignment index 2 read FVertTextAlign
write SetTextAlign;
end;

Пример:

V:=Excel.Workbooks[k].Sheets[j].Cells[Row,Col];
AssignCellFormat(V,CellFormat);



Страницы: 1 вся ветка

Текущий архив: 2004.02.25;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.022 c
1-79983
frost
2004-02-13 06:48
2004.02.25
32 bit иконки.


7-80310
hooky-mars
2003-12-04 21:59
2004.02.25
ESC принтера


9-79523
Unknown user
2003-08-05 18:29
2004.02.25
В каких программах проще всего создавать 3Д модели?


6-80059
Mouse
2003-12-19 11:10
2004.02.25
Client/Server Socket - в чем именно проблема?


3-79632
MaxBgmz
2004-01-29 23:47
2004.02.25
альтернатива Парадоксу