S
Sathyaish
When I set this formula through VB code,
code:
--------------------------------------------------------------------------------
=((D6*G6)+(E6*1.5*G6)+I6+J6+K6+L6)
--------------------------------------------------------------------------------
for a cell it makes this formula the text of the cell and not the
formula.
Here's my code:
code:
--------------------------------------------------------------------------------
StrFormula = " =((" & GetColumnAlphabet(colRegularHours) &
LngCurrentRow & "*" & GetColumnAlphabet(colPayRate) & LngCurrentRow &
")" & _
"+(" & GetColumnAlphabet(colOvertime) & LngCurrentRow &
"*1.5*" & GetColumnAlphabet(colPayRate) & LngCurrentRow & ")" & _
"+" & GetColumnAlphabet(colSalary) & LngCurrentRow & "+" &
GetColumnAlphabet(colCommission) & LngCurrentRow & _
"+" & GetColumnAlphabet(colBonus) & LngCurrentRow & "+" &
GetColumnAlphabet(colOther) & LngCurrentRow & ")"
Debug.Print StrFormula
Range(GetColumnAlphabet(colGrossTotal) &
LngCurrentRow).Formula = StrFormula
code:
--------------------------------------------------------------------------------
=((D6*G6)+(E6*1.5*G6)+I6+J6+K6+L6)
--------------------------------------------------------------------------------
for a cell it makes this formula the text of the cell and not the
formula.
Here's my code:
code:
--------------------------------------------------------------------------------
StrFormula = " =((" & GetColumnAlphabet(colRegularHours) &
LngCurrentRow & "*" & GetColumnAlphabet(colPayRate) & LngCurrentRow &
")" & _
"+(" & GetColumnAlphabet(colOvertime) & LngCurrentRow &
"*1.5*" & GetColumnAlphabet(colPayRate) & LngCurrentRow & ")" & _
"+" & GetColumnAlphabet(colSalary) & LngCurrentRow & "+" &
GetColumnAlphabet(colCommission) & LngCurrentRow & _
"+" & GetColumnAlphabet(colBonus) & LngCurrentRow & "+" &
GetColumnAlphabet(colOther) & LngCurrentRow & ")"
Debug.Print StrFormula
Range(GetColumnAlphabet(colGrossTotal) &
LngCurrentRow).Formula = StrFormula