google spreadsheet - Bills sheet scripts -
i trying create spreadsheet create bills. have done in excel, , want use google sheets, having problems.
- i tried create function activated each time person clicks specific range
- i have save sheet specific name (for example value of a1 row + a2 row) , save google drive account
- i used
importrange()
import data of google form, if make copy of sheet have give permission display data. (how can without permission?)
each of these question on own. however, here's answer questions:
1) i tried create function have activated each time person click specific range
use onedit function perform whatever function wishing perform. however, values have changed in order perform function. there's no onclick() fucntion in gas (as mentioned here). however, here's simple example onedit:
function onedit() { var sheet = spreadsheetapp.getactivesheet(); var cell = sheet.getactivecell(); var actrow = cell.getrow(); var actcol = cell.getcolumn(); //assuming want range between rows 5-11 , column 2-9 if (actrow >= 11 && actrow<=5 && actcol >=2 && actcol<=9) { //implement function } }
2) i have save sheet specific name ( example value of a1 row + a2 row) , save google drive account
here's simple sample. have modify according use case should give idea regarding how it:
function moverows(){ var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.getsheetbyname('sheet1'); var numrows = sheet.getlastrow(); var srange = sheet.getrange(2, 1, numrows, 1); //leaving out header rows var data = srange.getvalues(); var destfolder = driveapp.getfolderbyid('*****'); var newspsheet = spreadsheetapp.create("billing target"); var newrows = "a"+(1+numrows); var newrange = "a2:"+newrows; //leaving out header rows newspsheet.getrange(newrange).setvalues(data); //if need file in specific folder driveapp.getfilebyid(newspsheet.getid()).makecopy("billing target", destfolder); }
3) i used import range import data of google form if make copy of sheet y have give permision display data (how can without permision)
as far know, can't without permission.
Comments
Post a Comment