Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

restricting data entry

Posted on 2011-03-01
14
Medium Priority
?
220 Views
Last Modified: 2012-05-11
Experts,
In my spreadsheet I use the following ranges for a specific purpose:
A12:A21 - Date Entered
F12:F21 - Invoice Date
G12:G21 - Invoice Amount

I would like to keep data from being entered in F12:F21 and G12:G21 unless there is a date in the corresponding range A:12:A21
0
Comment
Question by:Frank Freese
[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
  • 6
  • 6
  • 2
14 Comments
 
LVL 15

Assisted Solution

by:Berkson Wein
Berkson Wein earned 200 total points
ID: 35010390
To have conditional locking / unlocking of cells, you'll need to use VBA.

Here's an example that should be able to be adapted to your needs:
http://answers.google.com/answers/threadview/id/736450.html

Hope this is a good start and helps you out.
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35010452
You don't need VBA. Select cell F12. Navigate to tab Data. Click "Data Validation" in the "Data Tools" group.

Select "Custom" and enter this formula:

   =AND($A12>=DATE(2000,1,1),$A12<=DATE(2099,12,31))

Copy the formatting in cell F12 to the other cells.

Kevin
0
 
LVL 15

Expert Comment

by:Berkson Wein
ID: 35010492
I agree, that's a much better solution.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35010554
You can restrict the range of dates that must be entered in column A. For example, to restrict the dates to today to 31 days from today:

   =AND(A1>=TODAY(),A1<=TODAY()+31)

Kevin
0
 

Author Comment

by:Frank Freese
ID: 35010627
i goofed - all i really need to do is make sure that I have a date in A12 and F12 before I can enter data in G12
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35010645
Select cell G12. Navigate to tab Data. Click "Data Validation" in the "Data Tools" group.

Select "Custom" and enter this formula:

   =AND($A12>=DATE(2000,1,1),$A12<=DATE(2099,12,31),$F12>=DATE(2000,1,1),$F12<=DATE(2099,12,31))

Copy the formatting in cell G12 to the other cells.

Kevin
0
 

Author Comment

by:Frank Freese
ID: 35010827
I entered in the formula in G12 for data validation, entered in valid dates in A12 and F12 and an amount in G12 and I was kept from putting in an amount - it did not work.
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35010835
What dates did you enter?

Kevin
0
 

Author Comment

by:Frank Freese
ID: 35010877
in A12 2/28/2011
in F12 2/28/2011
0
 

Author Comment

by:Frank Freese
ID: 35010943
I treid something like this in if $A12 = "" and $F12 =""

 =AND($A12=””,$F12=””)

But I got an error stating range could not be found
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35010956
It works at my house.

See attached.

Kevin
Q-26856092.xlsx
0
 

Author Comment

by:Frank Freese
ID: 35011000
I also have a conditional formatting that also applies to G12 - could that be the problem
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 1800 total points
ID: 35011034
That should not interfere.

Can you post your workbook? If not, try to reproduce in another workbook with dummy data and, if the problem still exists, post that workbook.

Also, I forgot to mention that your must uncheck the "Ignore blanks" checkbox.

Kevin
0
 

Author Comment

by:Frank Freese
ID: 35011093
unchecking the ignore blanks was the difference - great - I'll close this and open a continuation
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

715 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