Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
The code to use is as follows Sub CalculateFormula(ByVal source As Integer, ByVal Dest As Integer) With DataSh With .Range(.Cells(source, 9), .Cells(Dest, 9)) .FormulaR1C1 = "=(10*RC4+7*RC5+4*RC6+RC7)/(RC4+RC5+RC6+RC7)" End With End With End Sub Note that .FormulaR1C1=... line is by itself that is it cannot be a continuation of the Second With statement. Alok Alok "sasha" wrote: alok, thanx a lot, that ws a gr8 explanation. u guys rock But when I put this formula, not the calculated value is appearing but this =(10*$D8+7*$E8+4*$F8+$G8)/($D8+$E8+$F8+$G8) The string itself!!!! Heres my function Sub CalculateFormula(ByVal source As Integer, ByVal Dest As Integer) With wsData With .Range(.Cells(source, 9), .Cells(Dest,9)).FormulaR1C1 = "= (10*RC4+7*RC5+4*RC6+RC7)/(RC4+RC5+RC6+RC7)" End With End With End Sub *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula for taking text out of column B and placing it into column | New Users to Excel | |||
Taking formula to text | Excel Worksheet Functions | |||
Autofilter COUNTA formula not taking into account hidden cells | Excel Discussion (Misc queries) | |||
need help w/ formula for taking lunch & overtime out of a 9 hour | Excel Discussion (Misc queries) | |||
Problem with formula - Taking too long for calculation | Excel Programming |