Think i solved it
Sub auto_run()
Dim a As Variant
Dim b As Variant
Dim s As Variant
'setup variables
a = 1
s = 7
'set values to variables
b = Application.InputBox(prompt:="Insert number of K values to test", Type:=1)
'box to ask for number of K values to test
Sheets("Calculations").Select
Rows("27:" & Rows.Count).Delete Shift:=xlUp
'deletes any rows below first K value (used mainly as a reset)
Sheets("K Table").Select
Rows("47:" & Rows.Count).Delete Shift:=xlUp
'deletes any rows below first K value (used mainly as a reset)
If b = a Or b > a Then
'start loop
Do Until b = a
Sheets("Calculations").Select
'switch to first sheet
Range("A24:L26").Select
Selection.Copy
'selects table to copy and copies it to clipboard
ActiveCell.Offset(s, 0).Select
ActiveSheet.Paste
'makes cell jump down 's' amount of rows and pastes table (s initially at 7)
Sheets("K Table").Select
'switches to second sheet
Application.CutCopyMode = False
Range("A41:R46").Select
Selection.Copy
'selects calculations to copy and copies it to clipboard
ActiveCell.Offset(s, 0).Select
ActiveSheet.Paste
'makes cell jump down 's' amount of rows and pastes table (s initially at 7)
a = a + 1
s = s + 7
'updates loop counter
Loop
'ends copy and paste part of loop on both sheets
Else
MsgBox "error!"
'displays if loop contains error
End If
'ends loop
Sheets("Calculations").Select
'switches to first sheet for easy viewing
End Sub
Bookmarks