Sorry, can't open your file...
What about this? As I understand that's mainly what you are looking for (taking into account I don't know what are you trying to calculate from this 2 inputs).
![]()
Sub test() Offset = 2 Set ws = ThisWorkbook.Worksheets(1) For n = 1 To 40 For p = 1 To 100 ws.Cells((n - 1) * 100 + p - 1 + Offset, 2).Value = n ws.Cells((n - 1) * 100 + p - 1 + Offset, 3).Value = p ws.Cells((n - 1) * 100 + p - 1 + Offset, 4).Formula = "=RC[-1]*RC[-2]" Next p Next n End Sub
Bookmarks