PDA

View Full Version : Diaplay text in a cell



sujittalukde
07-21-2007, 04:39 AM
In the attached WB I want that a value shall always be present at a cell . Can this be done? More wxplanations are given at the WB?

Bob Phillips
07-21-2007, 04:42 AM
Why not just pre-load the cell with that value?

sujittalukde
07-21-2007, 04:44 AM
Since I am using the list by valiadtion list, this may be subject to deletion. THis led some user to skip the cell which I experienced. So I wnat that a value "Select from the list" should always be appear in the cell.

Bob Phillips
07-21-2007, 04:47 AM
Then that would need VBA, or don't allow deletions.

sujittalukde
07-21-2007, 04:53 AM
How can I restrict deletion? or Could the VBA be provided?

Bob Phillips
07-21-2007, 05:14 AM
Restrict deletion by just unchecking the Ignore Blank box in the DV.

sujittalukde
07-22-2007, 10:00 PM
I have unchecked the Ignore blank box in data validation, but deletion is still taking place and the cell goes blank.

rory
07-23-2007, 06:04 AM
Right-click the sheet tab, choose View Code and then paste this in:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [B3]) Is Nothing Then Exit Sub
On Error Resume Next
Application.EnableEvents = False
If Len([B3]) = 0 Then [B3] = "--SELECT FROM LIST--"
Application.EnableEvents = True
End Sub


HTH
Rory

sujittalukde
07-23-2007, 06:11 AM
Thank you Rory, this is what I was looking for. Many Many thanks for the code.