Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel
Message
De
14/01/2005 10:55:34
Todd Cottengim
Alpine Land Information Services
Redding, Californie, États-Unis
 
 
À
13/01/2005 19:35:27
Maltin Lacsina
Angeles Electric Corporation
Angeles, Philippines
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Re: Excel
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
00977010
Message ID:
00977215
Vues:
22
>How can I format a entire column of excel using vfp?
>For example when I put a numeric value in a cell it get a cell money format.

For the following examples, assume the following:
oExcel = Instance of Excel in VFP
lcWorkbookName = The stem of the file name
lcWorksheetName = The name of the worksheet

The format will be Dollar with two decimals
To format all of column "C":
oExcel.Workbooks(lcWorkbookName).Worksheets(lcWorksheetName).Columns("C").NumberFormat = "$#,##0.00"

To format all of Row 4:
oExcel.Workbooks(lcWorkbookName).Worksheets(lcWorksheetName).Rows(4).NumberFormat = "$#,##0.00"

To format a the range A17 to C30
oExcel.Workbooks(lcWorkbookName).Worksheets(lcWorksheetName).Range("A17:C30").NumberFormat
The RANGE() property also takes RANGE(CELLS(x,y), CELLS(x,y)) if you don't know the letter of the column
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform