Originally Posted by
mikerickson
"how to get a click to add 1 to that number with each click and then go back to 1 after I reach 5."
Sub ButtonClick()
With Range("A1")
.Value = (.Value Mod 5) + 1
End With
End Sub
Thanks everyone! Unfortunately I couldn't open your attachments because I don't have enough post points? I'll have to go find some easy questions to answer correctly so I can boost my points.
I was able to get an answer that works in Excel, but it turns out Google doesn't use VBA (probably should have checked that first). Can anyone recode this into GAS?
Option Explicit
Private Sub CommandButton1_Click()
Dim Rng As Range
Static n
Set Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
n = n + 1
n = IIf(n = Rng.Count + 1, 1, n)
Range("B1") = Rng(n)
End Sub