Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Formula in a cell

Status
Not open for further replies.

IanPikeBioquell

IS-IT--Management
Mar 3, 2008
12
GB
Can anybody please help, I have a script that reads data in from an SQL database. At the end of a row of data I want to enter a formula that sums that row. (the row will not always have the same number of columns in it)

I genearate the formular as follows

formular = "=sum(RC[-" & Count - 1 & "]:RC[-1])"

this returns

=sum(RC[-19]:RC[-1]) (for example)

but when I use to populate the cell

.Cells(22, Count + 1).FormulaR1C1 = formular

the cells value becomes

=SUM(R[-1]C[217]:R[-1]C[235])


Hope this is clear and that someone can help. I am using Excel 2003 on a Vista PC.
 
Thanks for all this guy's, sorry i have been away from my desk for a while in meetings!

Let me try and digest what you have said and give it try. Will probably not be untill tomorrow now.

Again thanks for all you help and suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top