In VBA for Excel, I can get the column of the cell making the call to a custom function like this:
ThisCol = Application.Caller.Column
What is the equivalent in Google Scripts?
I've been trying to find my way through the API docs, but coming up empty....
I call this function in a cell in each row of a range. The function sums contents of a range of cells across the row. Here's the VB:
Public Function SumDays(row As Integer) Dim credit As Double NumCols = Range("D8", Range("D8").End(xlToRight)).Columns.Count ThisRow = row ThisCol = Application.Caller.Column ' column containing the cell calling the fn credit = 0 For i = (ThisCol + 3) To NumCols 'do stuff across the range of cols in ThisRow ' If Cells(ThisRow, i) = .... Next i SumDays = credit End Function