I'm trying to do the following in a google sheet:
Problem 1:
Cell B2, B3 & B4 have the data I want to copy into the last row of Columns C, D, & E
The following code below works fine, it just gets the last row of the sheet, and I can't localize it to those columns.
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sinput = ss.getSheetByName("DEPOSITS_WITHDRAWLS");
var soutput = ss.getSheetByName("DEPOSITS_WITHDRAWLS");
var input = sinput.getRange(2, 2, 3).getValues();
sinput.getRange(3,2, 2).clear();
var flatin = [].concat.apply([], input);
soutput.getRange(soutput.getLastRow()+1, 3,1,3).setValues([flatin]);
soutput.insertRowAfter(soutput.getLastRow());
Logger.log(input);
Problem 2:
I made a drop-down in cell B1 which has "Option 1" & "Option 2"
I want to make an if/else out of it. The only difference is the data will either go to the last rows of columns C, D, & E for "Option 1" or go to the last rows of columns G, H, & I for "Option 2". The following code looooks like it would work, but I don't really recognize the language. Is it for excel? Either way, I feel like both of these are close, but I'm completely lost on how to implement them. Any help is greatly appreciated. Thanks and have a great day.
If optMemberName.Value = True Then
With Sheets("Sheet1")
Range("A" & .Cells(.Rows.Count, "A").End(xlUp).Row) = txtMemberName.Text
End With
ElseIf optMemberID.Value = True Then
With Sheets("Sheet1")
Range("B" & .Cells(.Rows.Count, "B").End(xlUp).Row) = txtMemberID.Text
End With
End If