I made a script:
function getWN8() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var startRow = 11;
var queryString = Math.random();
var dataRange = sheet.getRange(startRow, 3)
var data = dataRange.getValues();
var values = SpreadsheetApp.getActiveSheet().getDataRange().getValues()
var input, cellFunction, range, row;
for (var n=startRow-1; n < values.length;++n){
input = values[n][0];
row = values[n];
cellFunction = '=INDEX(IMPORTHTML("http://en.wot-life.comeu/player/' + input + '", "table", 1),16,2)';
for (var i = 0; i < row.length; ++i) {
range = sheet.getRange((n+1), 2);
range.setValue(cellFunction);
}
}
}
This script is reading values from first column, insert value from first column to http link and output is pushed into cells in 2nd column. But If I look in sheet, I have displayed numeric value in cell, but it is threated as an formula. Therefore I can't set conditional formatting.
So all I need to do, is to push value to the cell instead of formula. How can it be done ? I'm not very skilled in scripting, or programming.
Thanks for any help
Ivo
You might want to use
setFormula(formula)
orsetFormulaR1C1(formula)
.Hope this helps.
To turn the formula into a value you will have to add something to your last iteration like:
Unfortunately, I haven't found a way calculate and put in the value directly by using a spreadsheet formula. To put in the value directly, it would require a code that is executing exactly the same math as the formula.