Solved

Excel 2007 VBA to Check for listbox selection

Posted on 2013-01-14
2
378 Views
Last Modified: 2013-01-14
I have a data validation list in cell E2.  I want to prevent data entry in cell E3 if a selection has not been made in E2.   Thus display an error message an lock E3

If a selection is made in E2 than I want to let a data value be entered in cell E3.  Thus no message and unlock E3.

I need these actions to occur when focus is on cell E3.
0
Comment
Question by:usernameX
2 Comments
 
LVL 29

Accepted Solution

by:
gowflow earned 500 total points
Comment Utility
is that what you want ?
make sure macroes are enabled and test this in Sheet1 for cells E2 and E3 it is VBA code.
gowflow
E2E3.xls
0
 
LVL 13

Expert Comment

by:Shanan212
Comment Utility
You can do this without VBA

Enter this as data validation formula on E3

=LEN(E2)>0

Also uncheck choose  'ignore blank' and enter error message as I entered.

This wouldnt let any entries on E3 as long as E2 is blank (or length of E2 value is zero)

See book attached
Book1.xlsx
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now