+ Reply to Thread
Results 1 to 2 of 2

Set default value in cell?

  1. #1
    Registered User
    Join Date
    05-05-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    26

    Set default value in cell?

    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?

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Set default value in cell?

    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 cell
    A2: leave blank, leave cell unlocked
    A3: enter formula below and lock the cell
    =IF(A2="",A1,A2)
    In other cells where you need the result, refer to A3 instead of 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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 12-10-2013, 01:44 PM
  2. Replies: 3
    Last Post: 10-16-2013, 07:17 AM
  3. [SOLVED] How to make a dropdown list cell default to blank, after another cell selection is made
    By chardsmith in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-30-2013, 03:46 AM
  4. Replies: 1
    Last Post: 08-10-2012, 10:01 AM
  5. Prefill MonthDate,Clear cell & Default to last blank cell
    By SVTF in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-17-2011, 10:08 PM
  6. Insert cell A value into default text cell D for each specific row
    By badasstoymaster in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2010, 03:40 PM
  7. Replies: 2
    Last Post: 11-17-2008, 09:14 PM
  8. Default Cell
    By swfisher in forum Excel General
    Replies: 3
    Last Post: 05-14-2008, 11:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1