Solved

Is there a way to auto check data in a column in Excel 2007

Posted on 2012-03-19
4
281 Views
Last Modified: 2012-05-08
Each week I am given an Excel spreadsheet from another department. The number of rows vary from 100 to 300 or so, but the columns (A-AN) never change.

The data in Column L can only have one of 3 options in it: 361111759, 361111223, or anything starting with DDY (example DDY123478).

Is there an easy way to create a "check" to make sure one of those 3 are in Column L?

I know I can go to the Toolbar | Sort & Filter | Filter and glance at the list and do the check from there, but am wondering if there is a quicker, slicker way to do it?

Thanks!
Megan
0
Comment
Question by:wgraphics
[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
4 Comments
 
LVL 12

Expert Comment

by:kgerb
ID: 37738747
Hello Megan,
I think this macro will do what you want.  if you need help implementing let me know.

Sub CheckStuff()
Dim r As Range
Dim s1 As String, s2 As String
s1 = "One of the three exists"
s2 = "None of the three exsts"
Set r = Range("L:L").Find(361111759, LookIn:=xlValues, lookat:=xlWhole)
Set r = Range("L:L").Find(361111223, LookIn:=xlValues, lookat:=xlWhole)
Set r = Range("L:L").Find("DDY123478", LookIn:=xlValues, lookat:=xlWhole)
If Not r Is Nothing Then MsgBox s1, vbInformation + vbOKOnly, "Info" Else MsgBox s2, vbInformation + vbOKOnly, "Info"
End Sub

Open in new window

Kyle
0
 
LVL 12

Assisted Solution

by:kgerb
kgerb earned 250 total points
ID: 37738777
If you're looking for formulas these will do the trick.  You could combine them all into one long nested function if you wanted.

=IF(ISNA(MATCH(361111759,L:L,0)),"Does not exist", "Exists")
=IF(ISNA(MATCH(361111223,L:L,0)),"Does not exist", "Exists")
=IF(ISNA(MATCH("DDY123478",L:L,0)),"Does not exist", "Exists")

Kyle
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 250 total points
ID: 37741308
Megan,

Slightly different interpretation of your question from Kyle; I believe Kyle is giving suggestions to find if at least one of the options exists.

I believe you need to check that ALL entries are one of the 3 options and nothing else.

You can do this with a simple formula:

=COUNTIF(L:L,361111759)+COUNTIF(L:L,361111223)+COUNTIF(L:L,"DDY123478")-COUNTA(L:L)

If all entries are the required values, the result will be zero. If not zero then you can use the AutoFilter option to put a dropdown on the top of the column and the dropdown will show all entries so you can then filter for the erroneous entries.

Alternatively, just use the AutoFilter function to show the used entries.

Thanks
Rob H
0
 

Author Closing Comment

by:wgraphics
ID: 37944272
Holy cow you guys, so sorry for not responding. That entire project/question totally got sidetracked. My apologies!! If I ever get back to that project I will try what you have submitted for me. Meanwhile I split the points- Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

696 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