15.03.2020 Views

perl-language-es

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

#Edit the format of the text (font)

$Sheet->Range("G7:H7")->Font->{Bold} = "True";

$Sheet->Range("G7:H7")->Font->{Italic} = "True";

$Sheet->Range("G7:H7")->Font->{Underline} = xlUnderlineStyleSingle;

$Sheet->Range("G7:H7")->Font->{Size} = 8;

$Sheet->Range("G7:H7")->Font->{Name} = "Arial";

$Sheet->Range("G7:H7")->Font->{ColorIndex} = 4;

#Edit the number format

$Sheet -> Range("G7:H7") -> {NumberFormat} = "\@";

# Text

$Sheet -> Range("A1:H7") -> {NumberFormat} = "\$#,##0.00";

# Currency

$Sheet -> Range("G7:H7") -> {NumberFormat} = "\$#,##0.00_);[Red](\$#,##0.00)"; # Currency

- red negatives

$Sheet -> Range("G7:H7") -> {NumberFormat} = "0.00_);[Red](0.00)";

# Numbers

with decimals

$Sheet -> Range("G7:H7") -> {NumberFormat} = "#,##0"; # Numbers

with commas

$Sheet -> Range("G7:H7") -> {NumberFormat} = "#,##0_);[Red](#,##0)";

# Numbers

with commas - red negatives

$Sheet -> Range("G7:H7") -> {NumberFormat} = "0.00%";

# Percents

$Sheet -> Range("G7:H7") -> {NumberFormat} = "m/d/yyyy"

# Dates

#Align text

$Sheet -> Range("G7:H7") -> {HorizontalAlignment} = xlHAlignCenter;

text;

$Sheet -> Range("A1:A2") -> {Orientation} = 90;

text

# Center

# Rotate

#Activate Cell

$Sheet -> Range("A2") -> Activate;

$Sheet->Hyperlinks->Add({

Anchor

=> $range, #Range of cells with the hyperlink; e.g. $Sheet->Range("A1")

Address

=> $adr, #File path, http address, etc.

TextToDisplay => $txt, #Text in the cell

ScreenTip => $tip, #Tip while hovering the mouse over the hyperlink

});

NB: para recuperar la lista de hipervínculos, eche un vistazo a la siguiente publicación Obtención

de la lista de hipervínculos de una hoja de cálculo de Excel con Perl Win32 :: OLE

4. Manipulación de Filas / Columnas.

#Insert a row before/after line 22

$Sheet->Rows("22:22")->Insert(xlUp, xlFormatFromRightOrBelow);

$Sheet->Rows("23:23")->Insert(-4121,0); #xlDown is -4121 and that xlFormatFromLeftOrAbove

is 0

#Delete a row

$Sheet->Rows("22:22")->Delete();

#Set column width and row height

$Sheet -> Range('A:A') -> {ColumnWidth} = 9.14;

$Sheet -> Range("8:8") -> {RowHeight} = 30;

$Sheet -> Range("G:H") -> {Columns} -> Autofit;

# Get the last row/column

my $last_row = $Sheet -> UsedRange -> Find({What => "*", SearchDirection => xlPrevious,

SearchOrder => xlByRows}) -> {Row};

https://riptutorial.com/es/home 27

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!