title: How to convert VBA script to Google Apps Script automatically?
body: <p>VBA is the language, in which excel macros were written. Google sheets only supports Google apps script as a macro language. Is there a direct or automatic way to convert a VBA script to a Google Apps Script script without rewriting the code?</p>
  <p>Here is a sample VBA script, that I am trying to convert:</p>
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
      Dim rngStart As Range, rngCrit As Range
      Set rngStart = Range(&quot;A3&quot;)
      Set rngCrit = Range(&quot;B1&quot;)
      On Error GoTo ExitPoint
      Application.EnableEvents = False
      If Not Intersect(Target, rngCrit) Is Nothing Then
          Range(rngStart, Cells(Rows.Count, rngStart.Column).End(xlUp)).ClearContents
          If Val(rngCrit) &gt; 0 Then
              With rngStart.Resize(Val(rngCrit))
                  .Value = &quot;=ROW()-&quot; &amp; rngStart.Row - 1
                  .Value = .Value
              End With
          End If
      End If
  ExitPoint:
      Set rngStart = Nothing
      Set rngCrit = Nothing
      Application.EnableEvents = True
  End Sub
  </code></pre>
  <h3>What I've tried:</h3>
  
  <p>I've tried to substitute some of the commands with some of the equivalent Google Scripts. My issue is I am thinking too linear. I am trying to code the same exact way as VBA and just trying to switch keywords from VBA to ones in Google Script. I was hoping there was a direct method.</p>