I have a spreadsheet which contains a cell (B4) where a currency amount can be entered (e.g. £325.00), and the cell is formatted as currency, with two decimal places, with a currency symbol. I've added a formula to that cell so that the currency figure can be automatically populated if the user uses a different tab in the same spreadsheet, or the user can just enter a figure directly and overwrite the formula, and that all works fine.
The problem I'm having is, there is a button which runs a macro which clears the data from various cells, including cell B4:
Union(Range( _
"E27,E29,E31,F12:F18,F20,F23,F25,F27,F29,F31,B4,C4,D4,E4,F4,G4,I4:K16,B6:B8,C7,C7,C8,E6:E8,F7,F8,B11:B18,B20,B23,B25,B27,B29,B31,C12:C18" _
), Range("C20,C23,C25,C27,C29,C31,E11:E18,E20,E23,E25")).Select
Range("F31").Activate
Selection.ClearContents
Range("A1:K1").Select
What I would like is to modify these commands so that cell B4 is not cleared, but is instead returned to it's original state (where it contains the original formula), if it currently has a number amount in it (be it a number entered manually, or a number generated by the formula).
Is there a way I can do this?
Bookmarks