[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
3
Medium Priority
?
112 Views
Last Modified: 2014-11-17
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

Open in new window

0
Comment
Question by:gixxer1020
2 Comments
 
LVL 54

Accepted Solution

by:
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

Open in new window

Regards
0
 
LVL 50

Expert Comment

by:Martin Liss
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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…

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question