How can I set certain cells to have a default value (For example "0") ? So I have cells that users can input numbers into, but if the cells are blank is there a way that I can make sure the default value is always 0?
How can I set certain cells to have a default value (For example "0") ? So I have cells that users can input numbers into, but if the cells are blank is there a way that I can make sure the default value is always 0?
There are two ways I can think of to do this.
Using VBA, you could run a macro when the sheet is opened to check if certain cells are blank - if blank enter the default value, if not blank ignore. The problem with this is that after it's been run once those cells are now not blank, so the next time the macro will ignore them, which probably isn't what you want. VBA gurus on here may have a better solution.
A better solution, I think, is to use a different cell for user input from the cell you use to record the input or default value.A1: enter your default value, lock the cellIn other cells where you need the result, refer to A3 instead of A2.
A2: leave blank, leave cell unlocked
A3: enter formula below and lock the cell=IF(A2="",A1,A2)
Protect the sheet so the users can only write into the cell(s) you want them to.
Regards,
Aardigspook
I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
You don't need to give me rep if I helped, but a thank-you is nice.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks