Emulate simple VBA macro to be compatible with Google Sheets
09:47 25 Sep 2019

How can I convert this simple VBA to Google Sheets?

Sub SELECT()

Dim Cval As Variant
Cval = Sheet4.Range("A16").Value
Sheet4.Range("D1:T" & Cval).Select

End Sub

I keep getting errors while trying to use this macro in Google Sheets and I cannot find the issue.

The code I'm currently working on in Google Sheets:

function SELECTIE() {
  var spreadsheet = SpreadsheetApp.getActive();
  var Cval = spreadsheet.getRange("A16").Value
  spreadsheet.getRange("D1:T" & Cval).activate();
};
excel vba google-sheets google-apps-script