>>>>>Is it possible to get pagewise totals in Excel ??
>>>>>
>>>>>Any ideas/suggestions...
>>>>>
>>>>>TIA...
>>>>Vinod,
>>>>Take a look at subtotal method. Also there is sample code about it today title "....array...excel..".
>>>>Cetin
>>>
>>>I found that thread, Thnks for the tip and code...
>>>
>>>Only one question... How we can select a particular page.. i.e. How we can come to know where page ends (i want to automate this thing from vfp...)
>>>
>>>Pls advs...
>>Vinod,
>>I hope this helps as a starter :
#include "xlConstants.h"
>>USE home()+"samples\data\customer"
>>Application.datatoclip("customer",reccount(),3)
>>PUBLIC oExcel
>>oExcel = createobject("Excel.application")
>>Clear
>>WITH oExcel
>> .WorkBooks.Add
>> WITH .ActiveSheet
>> .Range("D20").select
>> .Paste
>> lcLastCell = .Range("A1").SpecialCells(xlLastCell).Address(.f.,.f.,xlA1)
>> ? lcLastCell
>> .Range("A1").SpecialCells(xlLastCell).Select
>> .Application.Selection.Offset(1).Select
>> ENDWITH
>> .visible = .t.
>>ENDWITH
Cetin
>
>Thnks !! This code is really helpful, uses some very useful methods (which I was not aware), but it still returns the last cell...
>
>Pls let me clear myself... If we take this same sample.. Data is pasted from customer.dbf into excel, and we have a column (last one) called maxordamt...I want total of this column on each page...
>
>Now say if i Go in Page setup and make this sheet.. Fit to 1 Pages wide and 2 pages tall... so 2 pages will be printed...
>
>What i want is Individual total on Each page... Suppose say user later on if user changes it to (Fit to 1 pages wide & 3 pages tall), then Total of individual page shud come on all 3 pages...
>
>What exactly i want to know is How we can chk end of each page, so we can set total formula there....
>
>Additionally you are using xlconstants.h file, What I have is "vfp_exce.h" file which I downloaded from John Harvest site.. Just want to reconfirm that both the files are same or not...
>
>Pls advs your comments...
Vinod,
Header files should be same in content (excel constants). I just made a find&replace in xl97cons.bas file and renamed it.
For page I never thought it was printer page :) How I sensed it was sheets :(
I'll look into this later and hope will have an idea via pagesetup.
BTW : Code was really intended to find last cell :)
Cetin