everyone. I need to change a code that I created in VBA to javascript and put it into Google Sheets. Does anyone know how I can do this? The code is below
Sub Influencers_automacao()
Sheets(1).Activate
Range("A1").Select
Selection.End(xlDown).Select
k = Selection.Row
For t = 2 To Sheets.Count
j = 2
For i = 2 To k
If Sheets(1).Cells(i, 1) = Sheets(t).Name Then
Sheets(t).Cells(j, 1) = Sheets(1).Cells(i, 2)
Sheets(t).Cells(j, 2) = Sheets(1).Cells(i, 3)
j = j + 1
End If
Next
Next
End Sub
xlDown? this is incomplete code. Also, sometimes it's better create something from scratch rather than convert, so what does this code do exactly?Selection.End(xlDown).Selectseems to be correct code to me. It should find the last non-empty cell in the selected range and select it.