diff --git a/src/app/components/pab-table/pab-table.component.ts b/src/app/components/pab-table/pab-table.component.ts
index 954e6e39deb3b7bfce16fb6b991ee70c5b53b600..1001e6e7d7d8ed58f8d2f13ad4335b60a9a086ef 100644
--- a/src/app/components/pab-table/pab-table.component.ts
+++ b/src/app/components/pab-table/pab-table.component.ts
@@ -270,6 +270,7 @@ export class PabTableComponent implements AfterViewInit, OnInit {
                     } else {
                         this.selectedItems.push(cell.selectable);
                     }
+                    this.sortSelectedItems();
                 }
 
             } else { // just a click
@@ -321,6 +322,36 @@ export class PabTableComponent implements AfterViewInit, OnInit {
         this.refresh();
     }
 
+    /**
+     * Ensures that this.selectedItems elements are ordered according to
+     * the walls order in the PAB (important for interpolation)
+     */
+    private sortSelectedItems() {
+        // extract PAB walls order
+        const wallsUIDs: string[] = [];
+        for (const c of this.pabTable.pab.children) {
+            wallsUIDs.push(c.uid);
+        }
+        wallsUIDs.push(this.pabTable.pab.downWall.uid);
+        // are items walls or devices ?
+        if (this.onlyWallsAreSelected(false)) {
+            // 1. walls : order by uid, according to model
+            this.selectedItems.sort((a, b) => {
+                const posA = wallsUIDs.indexOf(a.uid);
+                const posB = wallsUIDs.indexOf(b.uid);
+                return posA - posB;
+            });
+        } else {
+            // 2. devices : order by parent (wall) uid, according to model
+            this.selectedItems.sort((a, b) => {
+                const posA = wallsUIDs.indexOf(a.parent.uid);
+                const posB = wallsUIDs.indexOf(b.parent.uid);
+                return posA - posB;
+            });
+        }
+        return this.selectedItems;
+    }
+
     /**
      * Builds the editable data grid from the Pab model
      */
@@ -741,7 +772,13 @@ export class PabTableComponent implements AfterViewInit, OnInit {
      * returns true if at least one object is selected
      */
     public get enableEditPabButton() {
-        return this.selectedItems.length > 0;
+        return (
+            this.selectedItems.length > 0
+            && (
+                this.onlyDevicesAreSelected()
+                || this.onlyWallsAreSelected(false)
+            )
+        );
     }
 
     public onAddClick() {