Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set the fomula in a cell ?
Message
 
 
À
27/10/2010 22:57:12
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01487323
Message ID:
01487324
Vues:
47
>Hi,
>
>I want to set a SUM fomula to a cell, but the cell is "?NAME#'
>
>
>lnLastRow = oExcel.activesheet.UsedRange.Rows.Count
>oExcel.activesheet.Cells(lnLastRow+1,1).Formula = '=SUM(cells(1,1):cells(lnLastRow,1))
>
>
>Please advise.
>
>Derek Yim

Use names of the cells, not the cells(1,1)
lnCol = lnLastRow
oExcel.ActiveSheet.Cells(lnLastRow+1,1).Formula = '=SUM(A1:' +;
 IIF(lnCol>26, CHR(Int((lnCol - 1) / 26) + 64), "") + CHR(((lnCol - 1) % 26) + 65) + '1)'
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform