Loading ...
Sorry, an error occurred while loading the content.

Macro to delete duplicate table rows

Expand Messages
  • John Rethorst
    Table Delete Duplicate Rows Many tables with data from the web or other sources may have duplicate adjoining rows. This macro deletes those. Your insertion
    Message 1 of 5 , Jul 16, 2014
    • 0 Attachment
      Table Delete Duplicate Rows

      Many tables with data from the web or other sources may have duplicate adjoining rows. This macro deletes those. Your insertion point must be within a table you want to check.

      John R.


      If (!InTableFlag)
      Alert ("Your insertion point must be within a table.")
      Go (End)
      End If
      On Error (end)
      Assign (Var00;1)
      While (InTableFlag)
      Position To Cell (TableID;TableColumnNum;Var00)
      Select TableRow
      Copy
      Assign (Var01;Clipboard)
      Down ()
      Down ()
      Select TableRow
      Copy
      If (Var01=Clipboard)
      Delete Row (1)
      Else
      Assign (Var00;Var00+1)
      End If
      End While
      Label (end)
      Display (On)
    • John Rethorst
      Thanks to a list member for a question (but please post to the group, to encourage discussion) about this macro, and how to use it if the table has
      Message 2 of 5 , Jul 17, 2014
      • 0 Attachment
        Thanks to a list member for a question (but please post to the group,
        to encourage discussion) about this macro, and how to use it if the
        table has non-adjacent duplicate rows.

        If non-adjacent rows have duplicates, a sort on one or another column
        will produce adjacent rows. Add a column first with unique record
        I.D.s, such as an incrementing number, and then sort on that after
        removing duplicates, if you want to restore the original sort order.

        John R.
      • John Rethorst
        ... Tips & Macros has two ways to do this, one with static numbers and one with auto-updating numbers, and Table Manager has even more. Both free in the Files
        Message 3 of 5 , Jul 18, 2014
        • 0 Attachment
          > Add a column first with unique record 
          > I.D.s, such as an incrementing number,

          Tips & Macros has two ways to do this, one with static numbers and one with auto-updating numbers, and Table Manager has even more. Both free in the Files section here.

          John R.
        • Gilbert, Geoff
          Can someone point me in the direction of a Table on the Web that does this - I have never seen it à or possibly I have missed that it was happening à. ...
          Message 4 of 5 , Jul 18, 2014
          • 0 Attachment
            Can someone point me in the direction of a Table on the Web that does this - I have never seen it … or possibly I have missed that it was happening ….
            ------------------
            Geoff Gilbert
            Professor of Law
            Joint Editor-in-Chief, International Journal of Refugee Law
            School of Law and Human Rights Centre
            University of Essex
            Wivenhoe Park
            Colchester
            CO4 3SQ
            Tel +44 (0)1206 872557
            Fax +44 (0)1206 873428
            geoff@...


            On 18 Jul 2014, at 08:01, John Rethorst johnrethorst@... [wordperfectmac] <wordperfectmac@yahoogroups.com> wrote:



            > Add a column first with unique record 
            > I.D.s, such as an incrementing number,

            Tips & Macros has two ways to do this, one with static numbers and one with auto-updating numbers, and Table Manager has even more. Both free in the Files section here.

            John R.



          • jrethorst
            Raw data, or combinations of multiple tables. John R.
            Message 5 of 5 , Jul 21, 2014
            • 0 Attachment
              Raw data, or combinations of multiple tables.

              John R.
            Your message has been successfully submitted and would be delivered to recipients shortly.