Leaving a cell unchanged in a formula

Mel C Roberts

New Member
Joined
Feb 26, 2002
Messages
40
Hi,
I need to input an IF formula in cell C1 that says if A1 = "Total", then print D1 (which is formula) otherwise leave the contents of C1 as they are.
Is this at all possible??
Thanks so much Mel xx
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Do you mean that if it doesn't meet the requirement, then you want to leave C1 blank? If so it'd be:

=if(a1="total",d1,"")

Is this what you mean?
 
Upvote 0
Hi,
No what i mean is that column C1 has a list of numbers in it and I want to write some VB that overights that information ONLY IF A1 says "Total". Therefore when I mean leave it blank I meant to say don't change the information that already exists in that cell.
Cheers for the quick response.
Mel x
 
Upvote 0
So do you mean that you want a macro that would go down through the sheet and perform this function whenever you pressed a button?
 
Upvote 0
Audijoe,
I guess that would be best. In that case i want to be able to highlight three cells (there are three totals in the spreadsheet)eg A1, A10, A20, and return the formula in those cells, overrighting any value that is there but leaving the formatting alone (the format for each cell will be different ie one total background is green, one is blue and one is orange.) This would save the lookup function being used.
Cheers Mel
 
Upvote 0
Try this on your sheet. Paste it into a module and run it



Sub GoGeddemBoys()

lastRow = Cells.SpecialCells(xlCellTypeLastCell).Row

For n = 1 To lastRow
If Cells(n, 1).Value = "total" Then Cells(n, 3).Value = Cells(n, 4).Value
Next

End Sub
 
Upvote 0
Audiojoe,
I don't know how to thank you!
With a little bit of manipulation i now have a fully functional spreadsheet that does everything i want it to do!!
Thank you so much for your help.
Regards Mel xxxx
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,995
Members
448,539
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