Solved

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

Posted on 2012-03-19
4
263 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
  • 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 31

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

762 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

23 Experts available now in Live!

Get 1:1 Help Now