Display default value on delete

sandhya16

New Member
Joined
Jun 8, 2015
Messages
34
I have a range of data from A2:A10 that i am displaying through data validation drop down list.

I want to display a default value when i press delete on any of the cells in range .The default value -"Select Value" which will always be displayed when i am going to select a dropdown value.Please help.

eg-the dropdown should have value like this and select value will always be displayed even if i press delete or nothing is entered.

Select Value
A
B
C
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Upvote 0
Hi sandhya16

Were you able to download my File from the Drop Box? If so, did the Code work as expected?

I'll send my email address via Private Message.
 
Upvote 0
When i am selecting the whole range from A2:A10 and pressing delete then the default value "select value" is not getting displayed.its coming on single cell deletion..what changes are to be made for whole range?
 
Upvote 0
Hi sandhya16

Try this
Code:
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
   Dim cel          As Range
   '   If Target.Cells.Count > 1 Then Exit Sub
   If Not Intersect(Target, Range("A2:A10")) Is Nothing Then
      For Each cel In Range("A2:A10")
         Application.EnableEvents = False
         If IsEmpty(cel.Value) Then cel.Value = "Select Value"
      Next cel
   End If
   Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,984
Messages
6,122,601
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top