How to remove duplicates, but save the first instance and empty cell for duplicates in OpenOffice Calc?

If I have data such as:

A          B          C
111        asdews     iujfhg
111        oikufjf    jasddaf
112        eifjfjc    olkdkj
112        eiejdj     olokjjfki
112        ioeiurjf   oleodks
113        oeiekdkd   poldkkmd

I would like to delete all duplicates except the first instance, but keep the cell empty for all subsequent duplicates. Expected Result:

A          B          C
111        asdews     iujfhg
           oikufjf    jasddaf
112        eifjfjc    olkdkj
           eiejdj     olokjjfki
           ioeiurjf   oleodks
113        oeiekdkd   poldkkmd

, , - , . , , B C, . , , , , , ID. , ID, , - . , , , .

+4
1

Excel VBA. VBE, Alt - F11 . . , .

Sub RemoveRepeatingStrings()

    Dim BaseStr As String, CurrStr As String
    Dim EndRow As Long

    EndRow = Range("A" & Rows.Count).End(xlUp).Row
    BaseStr = Range("A1").Value

    Application.ScreenUpdating = False

    For Iter = 2 To EndRow
        CurrStr = Range("A" & Iter).Value
        If CurrStr = BaseStr Then
            Range("A" & Iter).Value = vbNullString
        Else
            BaseStr = Range("A" & Iter).Value
        End If
    Next Iter

    Application.ScreenUpdating = True

End Sub

:

enter image description here

:

enter image description here

, .

+13

All Articles