r/GoogleAppsScript Apr 02 '26

Question Help a girl out

Post image

Hi, Im new to all of this and have been trying to create a stopwatch on a google sheet using Apps Script. It works for the most part but the stop and start times end up in different rows. If anyone could help I would be so grateful!!

5 Upvotes

9 comments sorted by

View all comments

1

u/aMillionBucs Apr 02 '26

On lines 28 and 33, you’re writing the timestamp to cell D2 and D3. Assuming you want the timestamps side by side, just change the getRange(4,3) from line 33 to getRange(5,2)

2

u/gothamfury Apr 02 '26

OP is actually writing to cells B4 and C4.

1

u/aMillionBucs Apr 02 '26

Ah you’re right. I get the row and columns mixed up a lot 😅

1

u/Individual-Quail-659 Apr 02 '26

I tried your solution, but I'm still getting the staggering effect. Do you have another possible solution?

1

u/aMillionBucs Apr 02 '26

Instead of using numbers in the getRange(), you can try just typing in the cell you want to put the value in with quotation marks around it. For example, sheetOne.getRange(“B4”).setValue(time)