I get a syntax error where 'region' is highlighted in the deleteRows sub. I am not certain the subroutine can be called in the middle of the script where it needs to look at the state of a button on a separate window. Set m圜leanRange to get resize ( get offset (myMessyRange) column offset ((count of columns of myMessyRange) + 1)) row size 1Īdvanced filter myMessyRange action filter copy copy to range m圜leanRange with uniqueĭelete range (entire row of headerRow) shift shift upĭelete range (entire column of ( get resize myMessyRange column size ((count of columns of myMessyRange) + 1))) shift shift to left Set value of headerRow to get value of headerRow Set formula of headerRow to '=\'header\'&column()' Set headerRow to get resize (row 1 of myMessyRange) row size 1 column size (count of columns of myMessyRange) Insert into range (entire row of (row 1 of myMessyRange)) shift shift down Select all unneccesary cells that contain data or formatting and go to Home->Editing->Clear and select. Set myMessyRange to get current region of range 'A1' Then, select the slicer object and hit the delete button.