Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default how to show if a table contains the same data

Hi everybody,

has anybody any idea of how to somehow highlight or show if I have the
same value twice or more times in a column?

For instance

1 Tom
2 Dick
3 Harry
4 Tom


Then I would like to somehow hightlight Tom. Problem is I have a lot
of data I want to search through.

Any thoughts?

Best regards
Heine

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default how to show if a table contains the same data

Format/ Conditional Formatting/ Formula is/ =COUNTIF($B$1:$B$4,$B1)1, then
choose your highlighting format.
--
David Biddulph

"Heine" wrote in message
ups.com...
Hi everybody,

has anybody any idea of how to somehow highlight or show if I have the
same value twice or more times in a column?

For instance

1 Tom
2 Dick
3 Harry
4 Tom


Then I would like to somehow hightlight Tom. Problem is I have a lot
of data I want to search through.

Any thoughts?

Best regards
Heine



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 138
Default how to show if a table contains the same data

Heine,

here is a macro I wrote that will select all duplicates. It differs from
other approaches, which mostly rely on the COUNTIF function, because it
1) ignores the first instance (which I think can't be called a duplicate)
2) works on multiple selections (may not be interesting for you, but I need
that functionality in some cases).

Cheers,

Joerg Mochikun



Sub SelectDuplicates()
'Macro selects all duplicates (=second and more instances of same text or
value) either within selection or
'(if only 1 cell selected) in whole sheet.
'Hidden cells are ignored, selection of multiple ranges is supported
'Macro uses Regular Expressions and therefore requires a recent version of
Windows Scripting Host to be installed

Dim rng, MyArea As Range
Dim TotalCellValues, SearchString, i As String

Dim RegExp As Object
Set RegExp = CreateObject("VBScript.RegExp")

i = 0
If Selection.Cells.Count = 1 Then
Set rng = ActiveSheet.UsedRange
Else
Set rng = Intersect(ActiveSheet.UsedRange, Selection)
End If

For Each cell In rng
If cell.EntireRow.Hidden Or cell.EntireColumn.Hidden Then GoTo
EndForLoop
SearchString = "@" & cell.Value & "@"
TotalCellValues = TotalCellValues & "@" & cell.Value & "@"
RegExp.Pattern = "(@" & cell.Value & "@.*){2,}"
If RegExp.test(TotalCellValues) Then
If MyArea Is Nothing Then Set MyArea = cell
Set MyArea = Union(MyArea, cell)
End If


EndForLoop:
Next cell
If MyArea Is Nothing Then
MsgBox "No duplicates found!"
Else
MyArea.Select
End If

End Sub









"Heine" wrote in message
ups.com...
Hi everybody,

has anybody any idea of how to somehow highlight or show if I have the
same value twice or more times in a column?

For instance

1 Tom
2 Dick
3 Harry
4 Tom


Then I would like to somehow hightlight Tom. Problem is I have a lot
of data I want to search through.

Any thoughts?

Best regards
Heine



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show all data in pivot table naulerich Excel Discussion (Misc queries) 2 March 1st 06 09:42 PM
Show value in Data Table but not on live chart Gonepostal Charts and Charting in Excel 1 January 17th 06 12:23 PM
How to show data greater than 10 in pivot table Angus Excel Discussion (Misc queries) 6 September 15th 05 07:51 PM
Pivot Table - show items with no data HJM Excel Discussion (Misc queries) 3 June 22nd 05 12:51 PM
Can you show data in a data table but not plot it on the chart? Armadillo Charts and Charting in Excel 2 May 19th 05 01:08 PM


All times are GMT +1. The time now is 11:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"