timepro timesheet
unread,Nov 10, 2021, 12:49:05 AM11/10/21You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
hello all:
how to get SUM for a cell with more than 1 value, were each value is summed in that same cell.
coding:
TRY
oexcel=createobject('excel.application')
CATCH
mymessage(23,39,'excel application not installed/activated in this system',xm,xy,fcn,6,6,900)
dla6(24,39,'this report may crash',xm,xy,fcn,6,6,900);inkey(x)
END
oexcel=createobject('excel.application')
oexcel:workbooks:add()
osheet=oexcel:activesheet
...
...
do whil !eof()
...
for xxxx=1 to if(month=1.or.month=1.or.month=3.or.month=5.or.month=7.or.month=8.or.month=10.or.month=12,31,30)
if y1$'Ii';hrsandcharges=str(thisdayhrs[xxxx],2)+CHR(10)+str(thisdaycost[xxxx],8);end
cmemo+=chr(ktab)+if(y1$'Ii',["]+alltrim(hrsandcharges)+["],str(thisdayhrs[xxxx],2))
next
skip
endd
...
...
*after processing
GTSetClipboard(cMemo)
xsum(fromcell, tocell)
*in the same cell, should list different sums for both the thisdayhrs & thisdaycost of the same cell.
*********
func xsum(xs1,xs2)
*********
for xx=xs1 to xs2
oSheet:Cells(xrow,xx):Value="=SUM("+oSheet:Range(oSheet:Cells(nstart,xx),oSheet:Cells(xrow-1,xx)):Address( .F.,.F.)+")"
next
*thank you