Solved

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

Posted on 2012-03-19
4
272 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 32

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

832 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