daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Oct 12th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function test(){
  2.   var spreadsheet = SpreadsheetApp.getActive();
  3.   var ss = spreadsheet.setActiveSheet(spreadsheet.getSheetByName('UserInterface'), true);
  4.   var count = ss.getRange("H2").setFormula('=countif(TalukaName!B:B,UserInterface!C2)').getValue();
  5.   var DistrictName = ss.getRange('C2').getValue();
  6.   var matchindex = ss.getRange('H3').setFormula('=match(C2,TalukaName!B:B,0)').getValue();
  7.   var indexvalue = ss.getRange('H4').setFormula('=index(TalukaName!B:B,H3)').getValue();
  8.  
  9.   var array = [];
  10.   var ssTaluka = spreadsheet.setActiveSheet(spreadsheet.getSheetByName('TalukaName'), true);  
  11.   var range = ssTaluka.getDataRange();
  12.   var data = range.getValues();
  13.   for (var i = 0; i < count; i++) {
  14.     array[i]=  '"' + data[i+matchindex-1][0] + '"';
  15.   }
  16.  
  17.   ss.getRange('I2:I').setValues(array);
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top