title: Google Spreadsheets | How to get the first and last active cell in a range, and then return a cell offset from that cell
body: <p>I want to try to automate a very tedious process that I've been stuck with for a while now in my Gantt charts.</p>
  <p>I can get the range that I want to pull from, but what I really need are cells offset from that range corresponding with the first and last active cells in the range.</p>
  <p><img src="https://i.stack.imgur.com/zQt64.png" alt="Screenshot of what I am trying to describe" /></p>
  <p>Columns B and C are what I need automated. They represent Row 1's values on the first and last active cell per row.</p>
  <p>I'm familiar with how to do the opposite, to populate a range with something based on first and last values of column B/C. &quot;x&quot; however in my sheets is often different values which feed into other sources of code and are often changed by people other than myself, so I don't have many options on changing my workflow like this.</p>
  <p>Happy to provide any additional info, a solution in cell formulas or in scripts is perfectly fine, scripts would be actually be preferable but I'd be happy with either. Thanks for reading!</p>