Link to home
Start Free TrialLog in
Avatar of Go-Bruins
Go-Bruins

asked on

Google Sheets script efficiency

Hi all,

I'm just starting to learn the scripting language for Google Sheets. Here is some code that I'm experimenting with right now:

  var nowSpread = SpreadsheetApp.getActiveSpreadsheet(); // assigns active SpreadSheet to var "nowSpread"
  var nowSheet = nowSpread.getActiveSheet(); // assigns active sheet to var "nowSheet"
  var nowRange = nowSheet.getDataRange(); // assign active range to var "nowCell"
  var nowCell = nowSheet.getActiveCell(); // assigns ActiveCell to var "activeCell"
  var cellValue = nowCell.getValue(); // assigns cell value to var "cellValue"

*All* that code just to take the contents of the current cell and assign it to a variable.

Isn't there a simpler way? Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Go-Bruins
Go-Bruins

ASKER

Awesome - thanks.