Define Primary Keys

xlCompare gives you set of options to define Primary Keys on your worksheet.
This article describes all common operations you need to know.

Clear Primary Keys

Do the Right Click anywhere on the Worksheet and use menu command Clear Primary Keys. This command removes all Primary Key definitions from the sheet.
Right Click Menu: Clear Primary Keys

Set new Primary Keys

Method #1
  • Select rows or columns you need
  • Right click on the selected Heading Area
  • Use Set as Primary Key command
Right Click Menu: Set as Primary Key
You can select several columns at once and set them as Primary Keys. When you apply this command, previous Primary Key is cleared.
Method #2
Select Database | Primary Keys ... command on the Ribbon.
Or do the Right Click anywhere on the worksheet and use Manage Primary Keys ... command from the context menu.
You get this Window:
Manage Primary Keys
In this dialog you can select one of the opened workbooks, change worksheet and add or remove columns using left and right arrow buttons.
If you have complex Primary Key which contains columns which doesn't go one by one, you should use this method.
For additional information, please visit this page Manage Primary Keys.