?
Solved

Conditional formatting for duplicates and all numbers in a table

Posted on 2011-02-15
7
Medium Priority
?
390 Views
Last Modified: 2012-05-11
I have a very simple, but important task. I have attached a sheet and in that sheet I have a list of numbers in order. These numbers are station numbers that are used in a sequence to determine which station are dispatched to runs. I have about 200 sheets that I have to enter these station run numbers in various sequences.

It is very very important that each of the numbers shows up in each sheet. It is equal as important that I do no duplicate any numbers while enter them. I will make a validation list, so only these numbers will be accepted.

My questions is can I do some type of conditional formatting or validation so I don't repeat any numbers or I don't forget any numbers in each sheet?

Thanks for any help.

Brent RUN-ORDER.xls
0
Comment
Question by:bvanscoy678
[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
  • 3
  • 3
7 Comments
 
LVL 24

Expert Comment

by:StephenJR
ID: 34897150
Do you enter the sequences manually?
0
 

Author Comment

by:bvanscoy678
ID: 34897258
Yes, I enter the sequence manually.
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 34897288
Don't know if this is feasible for your actual file, but will produce a sheet at the end listing errors.
Sub x()

Dim ws As Worksheet, v, i As Long, vOut(), n As Long

v = Array(3, 31, 33, 1, 30, 34, 51, 5, 24, 61, 21, 22, 41, _
          53, 23, 52, 60, 42, 65, 43, 63, 56, 44, 77, 45, _
          "B1", "B3", "B2", "B5", "B6", "B4")
          
ReDim Preserve vOut(1 To Worksheets.Count * UBound(v), 1 To 3)

For Each ws In Worksheets
    For i = LBound(v) To UBound(v)
        If ws.UsedRange.Find(What:=v(i), Lookat:=xlWhole) Is Nothing Then
            n = n + 1
            vOut(n, 1) = ws.Name
            vOut(n, 2) = v(i)
        End If
        If WorksheetFunction.CountIf(ws.UsedRange, v(i)) > 1 Then
            n = n + 1
            vOut(n, 1) = ws.Name
            vOut(n, 3) = v(i)
        End If
    Next i
Next ws

Sheets.Add(After:=Sheets(Sheets.Count)).Name = "Errors"
With Sheets("Errors")
    .Range("A1").Resize(, 3) = Array("Sheet", "Not found", "Duplicate")
    .Range("A2").Resize(n, 3) = vOut
End With

End Sub

Open in new window

0
Industry Leaders: 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!

 

Author Comment

by:bvanscoy678
ID: 34898197
I'll be honest, this solution is a little difficult for me to understand.
0
 
LVL 42

Accepted Solution

by:
dlmille earned 2000 total points
ID: 34898783
Use this tip to avoid entering duplicate values in a row with data validation:

http://www.contextures.com/xlDataVal07.html#Unique
It uses the approach to count the number of entries like the one you're entering in a range and if > 1 then doesn't let you enter the value.

Dave
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 34898868
Happy to try to explain if you think it's an approach you want to pursue, there will be others.
0
 

Author Comment

by:bvanscoy678
ID: 34902025
Yes, that will work fine.

Thanks for the offer to explain, but seems it works just fine.

Thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

771 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