Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to sort a col. in Excel
Message
De
07/07/2011 06:44:52
 
 
À
07/07/2011 06:32:38
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:
01517540
Message ID:
01517541
Vues:
52
>Hi,
>
>I want to sort a column in a Excel worksheet.
>how to code the sorting statement ?
>I record it in excel macro, but the syntax not valid in VFP9.
>
>Please advise.
>
>Thanks.
>
>
>lnLastRow = oExcel.activesheet.UsedRange.Rows.Count
>oExcel.activesheet.Range("A1:G"+TRIM(PADR(lnLastRow,11))).select
>Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
>
#define xlAscending   1
#define xlGuess       0
#define xlTopToBottom 1

lnLastRow = oExcel.activesheet.UsedRange.Rows.Count
oExcel.activesheet.Range("A1:G"+TRIM(PADR(lnLastRow,11))).select
WITH oExcel.Selection
     .Sort("A1", xlAscending,,,,,, xlGuess, 1, .f., xlTopToBottom)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform