[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Conditional formatting for duplicates and all numbers in a table

Posted on 2011-02-15
7
Medium Priority
?
399 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

650 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