Single calculation

Juan C

Board Regular
Joined
Mar 6, 2009
Messages
131
Help me here...
Is there a way for me to have a formula perform its calculation one time only... meaning that if the precedent data changes it (the formula) won't compute again, thus leaving the previous number it calculated unchange...
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Yard

Well-known Member
Joined
Nov 5, 2008
Messages
1,929
Once your formula has returned the result, copy it and then Edit > Paste Special > Values.
 
Upvote 0

Yard

Well-known Member
Joined
Nov 5, 2008
Messages
1,929
How will it get there in the first place without human intervention? You want some event to trigger a calculation and then store the result in a cell?

What formula is it?
What event will trigger it?
 
Upvote 0

Juan C

Board Regular
Joined
Mar 6, 2009
Messages
131
How will it get there in the first place without human intervention? You want some event to trigger a calculation and then store the result in a cell?

What formula is it?
What event will trigger it?

Its feeding the data from a remote server. Lets say that the data is coming in in cell A1, and I want cell C1 to receive that data (=A1) and then freeze that data... meaning that even if A1 brings new data, the result previously obtained in C1 remains unchanged

By the way man, you look like Jackie Chan in that picture...;>))
 
Upvote 0

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Perhaps

Code:
Private Sub Worksheet_Calculate()
With Me.UsedRange.SpecialCells(xlCellTypeFormulas)
    .Value = .Value
End With
End Sub

To use this, right click the sheet tab, select View Code and paste in the code.
 
Upvote 0

Juan C

Board Regular
Joined
Mar 6, 2009
Messages
131
Perhaps

Code:
Private Sub Worksheet_Calculate()
With Me.UsedRange.SpecialCells(xlCellTypeFormulas)
    .Value = .Value
End With
End Sub

To use this, right click the sheet tab, select View Code and paste in the code.


GREAT!!! It works... Thanks.


Ooopsss but is freezing every other formula in my work sheet. I just need to freeze the results on cell C3
 
Last edited:
Upvote 0

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try

Code:
Private Sub Worksheet_Calculate()
With Me.Range("C3")
    .Value = .Value
End With
End Sub
 
Upvote 0

Juan C

Board Regular
Joined
Mar 6, 2009
Messages
131
Filling down data

Hello there... could somebody know how to fill column B with data that I receive on A1. I want to store every single chance of the data in A1 in column B....

Thanks for your help
 
Upvote 0

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,836
Office Version
  1. 2019
Platform
  1. Windows
Assuming that Cell A2 has the formula =A1 and A1 is the cell being remotely updated,

maybe:
Code:
Private Sub Worksheet_Calculate()
Cells(Rows.Count,"B").end(xlUp).Offset(1,0).Value = Range("A1").value
End Sub


EDIT:
Assuming that Cell A2 has the formula =A1 and A1 is the cell being remotely updated,
Note, I may be too cautious here. I don't trust programmatic changes because I don't have experience with them, so having some other cell depend on the programmatically changed cell is another triggering event.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,191,032
Messages
5,984,247
Members
439,879
Latest member
KingGoulash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top