+ Reply to Thread
Results 1 to 6 of 6

Set Default Value

  1. #1
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Set Default Value

    I have a column where I want to set a default value for every cell of 0.00. I want the user to be able to enter a value in any cell, but if the user changes their mind and deletes a value from any cell, the value in that cell should default back to 0.00 rather than appear blank.

    I came across this code, which almost works, but I'm unsure how to adapt it so that it will apply to any cell where the user deletes a value, rather than just the first cell (A2). My VBA is limited but I'm sure it is probably an easy tweak, I'm just not sure how to do it? At the moment any deleted values (see attached) will only be restored to the default 0.00 if the value in cell A2 is deleted, but it needs to work for all cells.

    Many thanks

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Set Default Value

    Try this..

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Set Default Value

    Hi Sixthsense,

    Perfect, that seems to do the trick...

    Many thanks

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Set Default Value

    Glad it helps you and thanks for the feedback and rep

  5. #5
    Registered User
    Join Date
    03-29-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Set Default Value

    Please Login or Register  to view this content.
    the above code is for the specified ranges which you can change..so any cell you delete within that range will default back to '0.00'

    let me know if it works for you

  6. #6
    Registered User
    Join Date
    03-29-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Set Default Value

    ah sixthsense got there first :D and it looks better too

+ 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. [SOLVED] Save As Dialog Box - Default Path and File Name, User Selects Sub Folder from Default Path
    By christenprochaska in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 05:17 PM
  2. Always default to $
    By LRamsay in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-08-2008, 07:06 PM
  3. Replies: 2
    Last Post: 11-17-2008, 09:14 PM
  4. default value
    By hustla7 in forum Excel General
    Replies: 8
    Last Post: 08-19-2006, 02:17 PM
  5. Replies: 0
    Last Post: 03-11-2005, 01:06 PM

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