powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Microsoft Office [игнор отключен] [закрыт для гостей] / БД Excel удаление повторяющихся записей?
2 сообщений из 27, страница 2 из 2
БД Excel удаление повторяющихся записей?
    #33339032
vallot
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Уже не надо, сам нашел этот топик!
...
Рейтинг: 0 / 0
БД Excel удаление повторяющихся записей?
    #34071793
Фотография Ivan33
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
dartvaiderЕсть документ Excel в нем очень большая куча записей - примерно 50 000 строк!
Записи отсортированы в алфавитном порядке и совпадений очень много!
Как можно сравнивать все строки в БД и удалять те, которые совпали, или удалять ту, которая уже повторилась и остовлять ту, с которой повторилась?

Пример таков?
Иванов Иван Иванович пр.Ивинова 10,кв 16
Иванов Иван Иванович пр.Ивинова 10,кв 16
Петров Петр Петорович пр.Петрова 10,кв 16
Петров Петр Петорович пр.Петрова 10,кв 16
Петров Петр Петорович пр.Петрова 10,кв 16
...............................................................

можно ли как нибуть удалить тех, кто повторился?
чтобы получился такой вид:
Иванов Иван Иванович пр.Ивинова 10,кв 16
Петров Петр Петорович пр.Петрова 10,кв 16


пробывал через функцию совпадения, но не сравнивать же 50 000 в ручную :(

=СОВПАД(A1;A2)

Можно ли как либо сравнить глабально?

***

авторWhen you are working with a large data table, it is not uncommon for the table to contain what is essentially duplicate information. To process the information in the table, you may want to remove any of the rows you consider duplicate, thereby paring down the amount of information you need to process.

For instance, let's say that the first cell of each row contains a part number. What if you want to delete any rows that have duplicate part numbers in the first cell? If you need this solution, the following macro is for you:

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
Sub DelDupRows()
    Dim rngSrc As Range
    Dim NumRows As Integer
    Dim ThisRow As Integer
    Dim ThatRow As Integer
    Dim ThisCol As Integer
    Dim RightCol As Integer
    Dim J As Integer, K As Integer

    Application.ScreenUpdating = False
    Set rngSrc = ActiveSheet.Range(ActiveWindow.Selection.Address)

    NumRows = rngSrc.Rows.Count
    ThisRow = rngSrc.Row
    ThatRow = ThisRow + NumRows -  1 
    ThisCol = rngSrc.Column
    RightCol = ThisCol + rngSrc.Columns.Count -  1 

    'Start wiping out duplicates
    For J = ThisRow To (ThatRow -  1 )
        If Cells(J, ThisCol) > "" Then
            For K = (J +  1 ) To ThatRow
                If Cells(J, ThisCol) = Cells(K, ThisCol) Then
                    Cells(K, ThisCol) = ""
                End If
            Next K
        End If
    Next J

    'Remove rows with empty key cells
    For J = ThatRow To ThisRow Step - 1 
        If Cells(J, ThisCol) = "" Then
            Range(Cells(J, ThisCol), _
              Cells(J, RightCol)).Delete xlShiftUp
        End If
    Next J
    Application.ScreenUpdating = True
End Sub
авторThe macro works on a selection you make before calling it. Thus, if you need to remove duplicate rows from the range D7:G85, simply select that range and then run the macro. It removes the duplicates from the range D7:D85, and then removes all rows in D7:G85 (four columns per row) for which the cell in column D is blank.
Савэт отсюда
...
Рейтинг: 0 / 0
2 сообщений из 27, страница 2 из 2
Форумы / Microsoft Office [игнор отключен] [закрыт для гостей] / БД Excel удаление повторяющихся записей?
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]