title: Excel Applescript to select column
body: <p>I'm trying to make an excel (v16.4) applescript that deletes the first few rows then moves to the last column, which will have the heading &quot;Notes&quot;, and copies that text into column F.</p>
  <p>The first part is working fine but I can't get it to select the column for me. The problem I've been having is that the &quot;Notes&quot; column is in a different spot in each file. I can get to the Notes column but nothing I've tried gets excel to select the whole column from this point, I just get the error &quot;The object you are trying to access does not exist&quot;. I've copied my last 2  applescripts for this bit below; I've tried a few options and had no luck.</p>
  <p>VERSION 1</p>
  <pre><code>-- find &quot;Notes&quot; column
              set lastRow to count of rows of used range of active sheet
              set theEnd to get end range &quot;A1&quot; direction toward the right
              select theEnd
              set x to (get column entry index of the active cell)
              select column x
  </code></pre>
  <p>VERSION 2</p>
  <pre><code>    --Find &quot;Notes&quot; column
              set findNotes to &quot;Notes&quot;
              set searchRange to range (&quot;A1:AN1&quot;)
              set foundColumn to find searchRange what findNotes with match case
              goto reference foundColumn
  
      --Duplicate Column
              set addr to get address (column 1 of selection)
              set addr to text 2 thru 2 of addr
              -- e.g range $H:$H&quot;
              set myWantedRange to &quot;$&quot; &amp; addr &amp; &quot;:$&quot; &amp; addr
              set src to range myWantedRange of sheet 1 of workbook &quot;Workbook1&quot;
              set dst to range column 6 of sheet 1 of workbook &quot;Workbook1&quot;
  
              copy range src destination dst
  </code></pre>