default value

A

ant

i need one cell to have a default value of "-" at all
times. Expect when a user enters a number. I just need
that cell to hava a value in it at all times.

How can i set the defaut value to "-" even when the
user blanks the cell that s going to be the value

How can i do this
 
S

Sandy Mann

Ant,

I would think that the fact that some of the big hitters around here have
answered other posts but not yours means that what you are asking for is not
possible - an empty cell has the value of an empty cell and by definition
cannot have anything else.

Formatting can change how the value in a cell will look but there must be a
value there to start with. As an example, if you format the cell as
Accounting with no symbol and give it a value of zero then it will show the
"-" that you are asking for but with no value in the cell it will show a
blank cell.

Regards

Sandy
 
J

JE McGimpsey

Can't do this with worksheet functions, but you can use an event macro.
One way:

Put this in the worksheet code module (right-click the worksheet tab and
choose View Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(.Cells, .Range("A1")) Is Nothing Then _
If IsEmpty(.Value) Then _
.Value = "-"
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top