I'm trying to automate a 60 step loop using the CycleThrough command button I made.
For i from 1 to 60 I want to:
... set cell J5 = i
... set value of cell at row # i of range M2:M61 to the value of cell K7
That's it. Each time J5 get's changed ten or so variables get set via in-cell INDEX-MATCH formulas and a few thousand of other cells get recomputed and spit out one grand result into K7, but i need to run 60 different cases. This is my first true written-from-scratch VBA (instead of cleaned up Macro Recorder) and I'm stumbling. I've used these forums to get this far but I can't tell where I'm going wrong. Thanks for reading/helping!
I had been using more comprehensive range callouts, Worksheets("StructAnalysis").Range
-------------------------
Private Sub CycleThrough_Click()
Dim i As Integer
Dim slope As Range
Set slope = Application.Range("M2:M61")
For i = 1 To 60
Application.Range(“J5”).Value = i
Application.Wait (Now + TimeValue("0:00:03"))
Application.Range(slope).Cells(i, 1).Value = Application.Range(“K7”).Value
Next i
End Sub
For i from 1 to 60 I want to:
... set cell J5 = i
... set value of cell at row # i of range M2:M61 to the value of cell K7
That's it. Each time J5 get's changed ten or so variables get set via in-cell INDEX-MATCH formulas and a few thousand of other cells get recomputed and spit out one grand result into K7, but i need to run 60 different cases. This is my first true written-from-scratch VBA (instead of cleaned up Macro Recorder) and I'm stumbling. I've used these forums to get this far but I can't tell where I'm going wrong. Thanks for reading/helping!
I had been using more comprehensive range callouts, Worksheets("StructAnalysis").Range
-------------------------
Private Sub CycleThrough_Click()
Dim i As Integer
Dim slope As Range
Set slope = Application.Range("M2:M61")
For i = 1 To 60
Application.Range(“J5”).Value = i
Application.Wait (Now + TimeValue("0:00:03"))
Application.Range(slope).Cells(i, 1).Value = Application.Range(“K7”).Value
Next i
End Sub