hide formula/total until entry

Roni

Board Regular
Joined
Apr 2, 2002
Messages
231
I have a formula in column D that subtracts the amount in Column C from the row above in Column D. I want the Column D total to only show the most recent total (and not the prior totals, and not the upcoming if the row in column C is still blank). does that make sense?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Can you post your formula?
Perhaps you need something like this?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myVar As Variant
If Target.Count > 1 Then Exit Sub
If Target.Column <> 3 Then Exit Sub
myVar = Target.Offset(-1, 1).Value - Target.Value
Columns(4).ClearContents
Cells(Target.Row, 4) = myVar
End Sub

lenze
 
Last edited:
Upvote 0
You could maybe do this with Conditional Formating, by making all text the same colour as the background, EXCEPT for the single total that you want to show.

For example, format the whole of Col D as white background, white text.

Then, let's say Row 10 is the last row that has an entry.

In cell D10, Format, Conditional Formating, Formula Is,
Code:
=and(C10<>"",C11="")
and format as black text.

Use Copy, Paste Special, Formats, to paste this format to the rest of Column D.
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,988
Members
448,538
Latest member
alex78

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