Created
August 28, 2017 00:11
-
-
Save rheajt/8ce2f2f8890fd4b2b837325f0aa040b8 to your computer and use it in GitHub Desktop.
call columns by their headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function callColumnsByHeaders() { | |
var ss=SpreadsheetApp.getActive(); | |
var sh=ss.getActiveSheet(); | |
var rg=sh.getDataRange(); | |
var vA=rg.getValues(); | |
var hA=vA[0]; //header row | |
for(var i=1;i<vA.length;i++) | |
{ | |
var row=[]; | |
for(var j=0;j<vA[0].length;j++) | |
{ | |
row[hA[j]]=vA[i][j]; | |
} | |
Logger.log('Email:%s Subject: %s Message: %s',row.Email,row.Subject,row.Message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment