0

I am trying to get a google doc to include an auto-fill of that day's date whenever a value in a row is changed.

I found an excel VBA code that does the trick (below). However, it won't work in google sheets.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row > 1 Then Cells(Target.Row, "B") = Date
End Sub

Do you know how to make this work in sheets, either as function or as code?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Peter Lauterborn
  • 11
  • 1
  • 1
  • 1

1 Answers1

3

Google Sheets does not support VBA -- which stands for Visual Basic for Applications, a Microsoft language derived from Visual Basic.

What Sheets does support is Javascript functions working just as macros.

Check this out for more information on Javascript macros.

Paulo Avelar
  • 2,140
  • 1
  • 17
  • 31