I’m using the Worksheet_Change event and I’m having trouble making the target (which happens to be a cell that is a data validation list) select the first item in the list whenever the user deletes the selected value? I’m trying to prevent empty or spaces from being entered in the cell. Or even better, to reselect the value in the list that the user deleted.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Data Validation List is Empty (2002)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Data Validation List is Empty (2002)
- This topic has 15 replies, 3 voices, and was last updated 16 years, 4 months ago.
Viewing 1 reply threadAuthorReplies-
WSHansV
AskWoody Lounger -
WSOmega3
AskWoody LoungerFebruary 2, 2009 at 4:50 pm #1145391Thanks Hans! This works great if the user deletes the value. I’m having trouble handing the situation if the user blanks the cell out. The second IF statement below doesn’t meet the condition.
If I use the Data Validation Error routine, I run into the problem if the user presses the Retry button and the entire list is missing. I’d rather capture it in the macro.
Any idea what I’m doing wrong?
This seems so simple that I must be brain dead today.
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("TargetDate")) Is Nothing Then If Target = " " Then ‘not working MsgBox "You must select a date", Title:="Error Message", Buttons:=vbExclamation Application.Undo End If If IsEmpty(Target) Then ‘this works when the cell is deleted MsgBox "You must select a date", Title:="Error Message", Buttons:=vbExclamation Application.Undo End If End If End Sub
-
WSHansV
AskWoody Lounger
-
-
-
WSOmega3
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSOmega3
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSOmega3
AskWoody LoungerFebruary 2, 2009 at 5:27 pm #1145417 -
WSHansV
AskWoody LoungerFebruary 2, 2009 at 7:27 pm #1145448Target could be more than one cell, for example if the user selects a range of cells and presses Delete. This could cause problems if you use Target – the value of a multi-cell range is undefined. Assuming that the TargetDate range is a single cell, it’s better to use Range(“TargetDate”).
-
WSOmega3
AskWoody Lounger -
zeddy
AskWoody_MVP -
WSHansV
AskWoody LoungerFebruary 3, 2009 at 5:24 pm #1145593 -
zeddy
AskWoody_MVP -
WSHansV
AskWoody Lounger -
zeddy
AskWoody_MVP
-
-
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
2 hours, 44 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
5 hours, 40 minutes ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
45 minutes ago -
National scam day
by
Susan Bradley
1 hour, 29 minutes ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
23 hours, 12 minutes ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
1 day ago -
Tools to support internet discussions
by
Kathy Stevens
1 day, 7 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
15 hours, 38 minutes ago -
AI is good sometimes
by
Susan Bradley
1 day, 7 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
21 hours, 47 minutes ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
2 days, 8 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
2 days, 6 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
2 days, 10 hours ago -
Excessive security alerts
by
WSSebastian42
1 day, 1 hour ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
2 days, 20 hours ago -
Ben’s excellent adventure with Linux
by
Ben Myers
13 hours, 12 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
2 days, 7 hours ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
1 day ago -
OS news from WWDC 2025
by
Will Fastie
10 hours, 56 minutes ago -
Need help with graphics…
by
WSBatBytes
1 day, 15 hours ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
3 days, 11 hours ago -
Totally remove or disable BitLocker
by
CWBillow
2 days, 10 hours ago -
Windows 10 gets 6 years of ESU?
by
n0ads
2 days, 13 hours ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
3 days, 22 hours ago -
Search Forums only bring up my posts?
by
Deo
3 hours, 12 minutes ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
4 days, 10 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
14 hours, 9 minutes ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
7 hours, 9 minutes ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
4 days, 20 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
4 days, 21 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.