Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Spreadsheet functions
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01162592
Message ID:
01162608
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
>Hi guys
>
>I need to do 2 things:
>
>1) from my current cursor I need to produce 3 worksheets in the same book, each being more of a summary of the previous.
>i.e. I have a cursor with all the data, cut down to sub-totals and totals, and cut down to just totals (and a grand total for each, of course). I know how to reduce the cursor for each sheet, but how to include each one in the same book.
>
2) VFP currently does the above totals/sub-totals but my users would prefer the SUM() function, as they may need to insewrt extra rows in the s/s/ afterwards. I imagine this is a bit tricky.

Actually, it's not too tricky, once you discover the property "Formula" of a cell object.
LOCAL nRowStart,nRowEnd
*m.nColumnStart && This will have to be translated into "A,B,C..." 
*m.nColumnEnd && This will have to be translated into "A,B,C..." 
*For simplicity, I'm not using the columns.  But you get the idea.

m.nRowStart = 1 && This may be dictated by your report layout
m.nRowEnd = 100 && This may be dictated by your report layout
exelApp.WorkSheets(1).Cells(1,2).Value = "Total:"
exelApp.WorkSheets(1).Cells(1,3).Formula = ;
    "=SUM(A" + transform(m.nRowStart) + ":A" ;
   + transform(m.nRowEnd) && This yields SUM(A1:A100)
HTH
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform