LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default Help with taking formula to vba code

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 ***

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula for taking text out of column B and placing it into column urlocaljeweler New Users to Excel 1 December 8th 09 06:47 PM
Taking formula to text Dkline Excel Worksheet Functions 3 April 29th 08 05:14 PM
Autofilter COUNTA formula not taking into account hidden cells Sarah Excel Discussion (Misc queries) 1 August 17th 07 01:17 PM
need help w/ formula for taking lunch & overtime out of a 9 hour jodee501 Excel Discussion (Misc queries) 2 March 31st 07 12:18 AM
Problem with formula - Taking too long for calculation Shashi Bhosale Excel Programming 2 September 9th 03 07:14 PM


All times are GMT +1. The time now is 10:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"