Writing google Javascript similar to vlookup

前端 未结 3 701
南笙
南笙 2020-12-09 21:53
ColumnA ColumnB
jhinz    115
tom      116 

The idea behind this code is someone enters a number (lets say 116), the computer looks it up in column

3条回答
  •  自闭症患者
    2020-12-09 22:39

    in its simplest form and to see the working principle you could try this :

    function findinB() {
      var sh = SpreadsheetApp.getActiveSheet();
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var last=ss.getLastRow();
      var data=sh.getRange(1,1,last,2).getValues();// create an array of data from columns A and B
      var valB=Browser.inputBox('Enter value to search in B')
      for(nn=0;nn

提交回复
热议问题