Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Default Value to Number cell

Cell D8 is formated as a number cell and unprotected.

How can I make ZERO ("0") the default value of this cell? Even if the user
hits the delete button a ZERO needs to be re-inserted.

Thanks in advance for your assistance.

Rick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default Default Value to Number cell

You can create the following procedu

Sub NeverBlank()

Dim wb As Workbook
Dim ws As Worksheet
Dim varVal As Variant

Set wb = ActiveWorkbook
Set ws = wb.ActiveSheet

varVal = Range("A1").Value

If Len(varVal) = 0 Then
Range("A1").Value = 0
End If

Set wb = Nothing
Set ws = Nothing

End Sub


And then invoke it from by running it from the Worksheets change event.
--
Kevin Backmann


"Rick_C" wrote:

Cell D8 is formated as a number cell and unprotected.

How can I make ZERO ("0") the default value of this cell? Even if the user
hits the delete button a ZERO needs to be re-inserted.

Thanks in advance for your assistance.

Rick

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
default number of copies Debbie Seibert Excel Discussion (Misc queries) 1 July 2nd 09 09:45 PM
Default Number Jodie Excel Worksheet Functions 1 October 27th 08 07:10 PM
Default number format DDC Excel Discussion (Misc queries) 0 July 15th 07 11:50 PM
default number format cmannaccountant Excel Discussion (Misc queries) 1 June 16th 05 09:36 PM
Default number of worksheets Nitin[_2_] Excel Programming 2 October 9th 03 09:04 PM


All times are GMT +1. The time now is 12:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"