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

x
?
Solved

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

Posted on 2012-03-19
4
Medium Priority
?
298 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 1000 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 1000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

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