Forum Discussion
Cell that auto fills by if statement or allows manual input
- May 13, 2022
The functional programming style of an Excel sheet formula is intended to prevent the reassignment of a new value to a cell such as you describe. On the other hand. an imperative programming language such as VBA is allowed to make such state changes. Hence HansVogelaar 's solution.
There is a trick that may achieve the effect you require without resorting to VBA. If you insert a new column D then a formula there can be made to display in column B, provided the cell in column B is blank. The default text in column D/C is heavily indented and right aligned in order to move it left into the adjacent cell.
This requires a bit of VBA code. See the attached workbook, now a macro-enabled workbook (.xlsm).
You'll have to allow macros when you open it.
To view the code, right-click the sheet tab and select View Code from the context menu.
- ElecEngineMay 24, 2022Copper ContributorThanks for your response, it works exactly how i intended, though a non VBA option allows more flexibility when i have to share over one-drive. Keep up the great work.