[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
Solved

Calculating Data in a Worksheet Using VBA

Posted on 2014-08-21
Medium Priority
112 Views
I would like to calculate data in a couple cells and have the results show in a cell without the formula showing in that cell.
This is what I have but it actually enters the formula in the cell, and all I want in the cell is just the results.
Thanks,
Edwin
``````    If Not Application.Intersect(Target, Range("O5:P1010")) Is Nothing Then
Range("S5:S1010").FormulaR1C1 = "=IF(ISERROR(IF(OR(RC[-3]="""",RC[-6]="""",RC[-4]=""""),"""",R3C12-(RC[-3]))),"""",IF(OR(RC[-3]="""",RC[-6]="""",RC[-4]=""""),"""",R3C12-(RC[-3])))"
Range("R5:R1010").FormulaR1C1 = "=IF(ISERROR(IF(OR(RC[-5]="""",RC[1]=""""),"""",RC[1]-(RC[-3]))),"""",IF(OR(RC[-5]="""",RC[1]=""""),"""",RC[1]-(RC[-3])))"
End If
``````
0
Question by:gixxer1020

LVL 54

Accepted Solution

Rgonzo1971 earned 2000 total points
ID: 40278274
Hi,

pls try

``````   If Not Application.Intersect(Target, Range("O5:P1010")) Is Nothing Then
Range("S5:S1010").FormulaR1C1 = "=IF(ISERROR(IF(OR(RC[-3]="""",RC[-6]="""",RC[-4]=""""),"""",R3C12-(RC[-3]))),"""",IF(OR(RC[-3]="""",RC[-6]="""",RC[-4]=""""),"""",R3C12-(RC[-3])))"
Range("R5:R1010").FormulaR1C1 = "=IF(ISERROR(IF(OR(RC[-5]="""",RC[1]=""""),"""",RC[1]-(RC[-3]))),"""",IF(OR(RC[-5]="""",RC[1]=""""),"""",RC[1]-(RC[-3])))"
Range("R5:R1010").Value = Range("R5:R1010").Value
Range("S5:S1010").Value = Range("S5:S1010").Value
End If
``````
Regards
0

LVL 50

Expert Comment

ID: 40446872
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Suggested Courses
Course of the Month20 days, 7 hours left to enroll