View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RjS, CISSP, CISA RjS, CISSP, CISA is offline
external usenet poster
 
Posts: 8
Default .Formula Property returning or setting inconsistent results?

Hi All - I have two sections of code; one to handle credits, and therefore
the formula includes "+" signs, and the other to handle debits, and the
formula includes "-" signs. The code for the Credits works fine and returns a
proper formatted formula line in all cases (that begins with an "=" sign).
The code for Debits never includes the "=" sign at the beginning of any
return strings.

Can anyone spot why?

Credit Code:
wsDST.Cells(InFundFirstMtyRow, iColCnt).Formula = _
CStr(wsDST.Cells(InFundFirstMtyRow, iColCnt).Formula) & "+"
& _
CStr(wsSRC.Cells(iRowCnt, "E").Formula)
Above returns strings like "=4357.76+2345.65"

Debit Code:
wsDST.Cells(OutFundFirstMtyRow, iColCnt).Formula = _
CStr(wsDST.Cells(OutFundFirstMtyRow, iColCnt).Formula) & "-"
& _
CStr(wsSRC.Cells(iRowCnt, "D").Formula)
Above returns string like "4357.76-2345.65"

Thanks Much :)