function Archivetimesheet(){
  var 
ss=SpreadsheetApp.openById("0AhioeCK_-aU4dGVWSDVlNXRxdzNseGJRNW...."); 
//From Current Workbook
  var sheet = ss.getSheetByName("Invoice");//From Current Sheet
  var data = sheet.getRange(5,1,sheet.getLastRow()-5,74).getValues(); 
  var archive= 
SpreadsheetApp.openById("0AhioeCK_-aU4dENCVjViWVhhdkZrd.....").getSheetByName("Sales");//To
 
Remote Workbook//
  var searchOne = 
archive.getRange(5,1,archive.getLastRow()-5,74).getValues();//To Remote 
Sheet ---->Line 6           
  var dest = [];
  var filter = 
SpreadsheetApp.openById("0AhioeCK_-aU4dENCVjViWVhhdkZrd...").getSheetByName("Sales").getRange("D2").getValue();
 
//Only Filter that row which is matching wiht D2
  Logger.log("getDataRange().getValues() data is " + data);
  for (var i = 1; i < data.length; i++ )
    {
     if (filter.test(data[i][3]) == filter )
      
dest.push([data[i][0],data[i][1],data[i][2],data[i][3],data[i][4],data[i][5],data[i][6],data[i][7],data[i][74]]);
    }
  //Logger.log(dest);
  if( dest.length > 0 ) {
    archive.insertRowsBefore(5,dest.length);
    archive.getRange(5,1,dest.length,dest[0].length).setValues(dest);
  }
}
//Error : The coordinates or dimensions of the range are invalid. (line 
6)Dismiss//

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to