IF then DO NOTHING

FoFJeremy

New Member
Joined
Oct 4, 2005
Messages
23
Hello

Does anybody know a way to create an IF fuction that basically says that if the logical test is false, leave the value that was in the cell alone?

I have a sheet that runs a number of calucations and I want to be able to output the results to one of 3 areas chosen by a in cell dropdown. Right now when I change the selection in the dropdown it turns the output from the previous set of caclulations to false.

I hope that this is clear and thanks for the help
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Not sure I'm following.

Is the old formula the same?

Could you show the IF statement and explain what is changing (or not)
 
Upvote 0
Hmm, maybe ..

=IF(test_condition,if_true,cell)

.. unless of course you are talking about trying to put a formula into a cell and return the same cell's previous value upon FALSE determination. That would create a circular reference which isn't what you want.
 
Upvote 0
That is exactly the case; I'm trying to return the previous value as the False case, obviously without creating some type of circular reference.

any way to accomplish this?
 
Upvote 0
Hi Jeremy,

I apologize for not seeing this sooner. Let's keep all related info away from pm's and on the board for everybody's benefit.

I would recommend you not use Circular Reference for this case. Excel has thousands and thousands of cells, plenty for us to use. Generally and usually, I'm of the opinion that Data should be entered seperately from anything formulated, i.e. reports, queries, etc.
 
Upvote 0
Use code, something like

Public PreVal As Variant
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
PreVal = Target.Value
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value > PreVal Then
Exit Sub
Else
Target.Value = PreVal
End If
End Sub

This goes in the WorkSheet module

lenze
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,457
Members
449,083
Latest member
Ava19

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
Back
Top