Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set grouping in a worksheet
Message
From
26/10/2010 07:31:32
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
26/10/2010 00:02:43
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01486712
Message ID:
01486968
Views:
36
>Hi,
>I save a macro, the result command as follows, but how to convert subtotal command in VFP9 ?
>
>
>Sub Macro1_group()
>'
>' Macro1_group 
>
>    Range("A1:C14").Select
>    Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(3), _
>        Replace:=True, PageBreaks:=False, SummaryBelowData:=True
>End Sub
>
>
The Excel commands usually come in two versions, one with "named parameters" which are not understood by Visual FoxPro, and one where the parameters are by position (as in Visual FoxPro). The parameters by position are usually in the same order as the saved macro, but I believe there is no guarantee for this; you had better check the VBA help for the Subtotal() function. If it is in the same order, it would be something like this:
oRange = oSheet.Range(oSheet.Cells(1, 1), oSheet.Cells(14, 3))
oRange.Subtotal(2, xlSum, Array(3), .T., .F., .T.)
This would be the approximate syntax, but unfortunately I don't know what array(3) refers to in this case, and how to convert it.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform