0

I have an excel spreadsheet that will delete rows of information for dates before today's date, preferably automatically. I have the VBA codes (I'm trying to decide which of these two I prefer) and I was wondering if one of you amazing people can translate this to work with Google Spreadsheets.

Dim i As Integer

For i = 1 To ActiveSheet.UsedRange.Rows.Count
     If *Date_is_Passed* Then
         ActiveSheet.Rows(rowToDelete).Delete
     End If  
  Next i

OR

Sub deleterows()
lastrow = Cells(Rows.Count, 4).End(xlUp).Row
For i = lastrow To 2 Step -1
    If Cells(i, 4).Value2 < Date Then Rows(i).EntireRow.Delete
Next i
End Sub

Thanks and virtual cookies.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • 3
    I'm voting to close this question as off-topic because SO is not a code-translation service – Tim Williams Jul 10 '18 at 18:45
  • Thanks for helping... perhaps instead of being rude about it, you could offer suggestions on where to find the info. – Queenie Jul 10 '18 at 18:53
  • Sorry that came over a bit short, but translating existing code to another platform is pretty much off-topic here. As for where to go to look for pointers, this would be a good place to get an overview of what you need: https://developers.google.com/apps-script/ – Tim Williams Jul 10 '18 at 19:12
  • Thank you... I had seen so many others on SO getting code translated, I didn't think it an issue. :-) – Queenie Jul 10 '18 at 19:24

0 Answers0