Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linked excel chart in PPT for export to other users 7 47
Excel if formula 2 19
VBA to Delete the Filtered Rows in an Excel Table 3 32
Web Query 1 19
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

809 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