Вы находитесь на странице: 1из 7

http://www.planetaexcel.

ru/techniques/2/103/

3.
, , - , .. , ..
,
.
.
, . , :

- , (
). 2 :
=((B$1:B2;B2)=1;(A$1:A1)+1;"")
:
=IF(COUNTIF(B$1:B2;B2)=1;MAX(A$1:A1)+1;"")
( ),
=1, .. - .
(, ,
100 ) . Excel -
(Formulas - Name manager) - - (Insert - Name - Define):

(A1:A100) - NameCount

(A1:B100) - NameList
NameList -
. ,
(VLOOKUP) :
=((NameCount)<(1:1);"";((1:1);NameList;2))
Excel:
=IF(MAX(NameCount)<row(1:1);"";vlookup(row(1:1);namelist;2))< font="" style="margin:
0px;"></row(1:1);"";vlookup(row(1:1);namelist;2))<>
NameCount
:

=($B$2:$B$25;((($B$2:$B$25;$B$2:$B$25;0)=($1:$24);
($B$2:$B$25;$B$2:$B$25;0);""

;()-1);1)

=($B$2:$B$25;(((($B$2:$B$25;$B$2:$B$25;0);""
=($1:$24);($B$2:$B$25;$B$2:$B$25;0);""

;()-1);1)

A2=((B$1:B2;B2)=1;(A$1:A1)+1;"")

http://excelexpert.ru/kak-v-tablice-excel-udalit-povtoryayushhiesya-stroki

Excel
Excel
. , Excel 2007, Microsoft
.
. 33.1 ,
. ,
.

. 33.1. ,

.
. Excel , . 33.2.

. ,
.
, .
,
.

, ,
, , . ,
: 5/15/2010, 15, 2010.
Excel , .

. 33.2.

OK, Excel ,
(. 33.3).

. 33.3. Excel

http://www.planetaexcel.ru/techniques/14/198/
, (
) :

, ? ,
,
.
Alt+F11 Visual Basic
(Developer), Insert - Module
:
?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Sub DuplicatesColoring()
Dim Dupes()
'
ReDim Dupes(1 To Selection.Cells.Count, 1 To 2)
Selection.Interior.ColorIndex = -4142
'
i = 3
For Each cell In Selection
If WorksheetFunction.CountIf(Selection, cell.Value) > 1 Then
For k = LBound(Dupes) To UBound(Dupes)
' -
If Dupes(k, 1) = cell Then cell.Interior.ColorIndex = Dupes(k, 2)
Next k
' , -
If cell.Interior.ColorIndex = -4142 Then
cell.Interior.ColorIndex = i
Dupes(i, 1) = cell.Value
Dupes(i, 2) = i
i = i + 1
End If
End If
Next cell
End Sub


Alt+F8 (Macros) (Developer).

: 54 .
.

http://excelvba.ru/code/DuplicatesColors

.
, .
,
( , , -
)
Sub ()
On Error Resume Next
' , -
Colors = Array(12900829, 15849925, 14408946, 14610923, 15986394, 14281213, 14277081, _
9944516, 14994616, 12040422, 12379352, 15921906, 14336204, 15261367, 14281213)
Dim coll As New Collection, dupes As New Collection, _
cols As New Collection, ra As Range, cell As Range, n&
Err.Clear: Set ra = Intersect(Selection, ActiveSheet.UsedRange)
If Err Then Exit Sub
ra.Interior.ColorIndex = xlColorIndexNone: Application.ScreenUpdating = False
For Each cell In ra.Cells ' dupes
Err.Clear: If Len(Trim(cell)) Then coll.Add CStr(cell.Value),CStr(cell.Value)
If Err Then dupes.Add CStr(cell.Value), CStr(cell.Value)
Next cell
For i& = 1 To dupes.Count ' cols
n = n Mod (UBound(Colors) + 1): cols.Add Colors(n), dupes(i): n = n + 1
Next
For Each cell In ra.Cells ' ,
cell.Interior.color = cols(CStr(cell.Value))
Next cell
Application.ScreenUpdating = True
End Sub

4414

, , EntireRow:
For Each cell In ra.Cells ' ,
cell.EntireRow.Interior.Color = cols(CStr(cell.Value))
Sub ()
On Error Resume Next
' , -
Colors = Array(12900829, 15849925, 14408946, 14610923, 15986394, 14281213, 14277081, _
9944516, 14994616, 12040422, 12379352, 15921906, 14336204, 15261367, 14281213)
Dim coll As New Collection, dupes As New Collection, _
cols As New Collection, ra As Range, cell As Range, n&
Err.Clear: Set ra = Intersect(Selection, ActiveSheet.UsedRange)
If Err Then Exit Sub
ra.Interior.ColorIndex = xlColorIndexNone: Application.ScreenUpdating = False
For Each cell In ra.Cells ' dupes
Err.Clear: If Len(Trim(cell)) Then coll.Add CStr(cell.Value),CStr(cell.Value)
If Err Then dupes.Add CStr(cell.Value), CStr(cell.Value)
Next cell
For i& = 1 To dupes.Count ' cols
n = n Mod (UBound(Colors) + 1): cols.Add Colors(n), dupes(i): n = n + 1
Next
For Each cell In ra.Cells ' ,
cell.EntireRow.Interior.Color = cols(CStr(cell.Value))
Next cell
Application.ScreenUpdating = True
End Sub

,
.
(5000 - , . 3-
"1"):
Sub Macro1()
For a = 1 To 5000
If Cells(a, 2).Value <> "" And Cells(a, 3).Value <> 1 Then
For b = 1 To 5000
If b <> a Then
If Cells(a, 2).Value = Cells(b, 2).Value Then
Cells(a, 2).Interior.ColorIndex = 4
Cells(b, 2).Interior.ColorIndex = 3
Cells(b, 3).Value = 1
End If
End If
Next
End If
Next
End Sub