Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel 2007 VBA to Check for listbox selection

Posted on 2013-01-14
2
Medium Priority
?
386 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 31

Accepted Solution

by:
gowflow earned 2000 total points
ID: 38776088
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
ID: 38776189
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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

610 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