How do i make this code run through each of the ranges individually? all it is giving me back is the first row of each of my x, y and z values
Sub Table2()
Set MyWorksheet = Worksheets("Simulation Real (4)")
MyWorksheet.Activate
SampleSize = Range("N14")
For Row = 1 To SampleSize
x = Range("M16:M26")
y = Range("N16:N26")
Z = Range("O16:O26")
Cells(28 + i, "M") = x
Cells(28 + i, "N") = y
Cells(28 + i, "O") = Z
Next Row
Set SimulatedValues = Range(Range("M29"), Cells(28 + SampleSize, "M"))
End Sub
Sub Table2()
Set MyWorksheet = Worksheets("Simulation Real (4)")
MyWorksheet.Activate
SampleSize = Range("N14")
For Row = 1 To SampleSize
x = Range("M16:M26")
y = Range("N16:N26")
Z = Range("O16:O26")
Cells(28 + i, "M") = x
Cells(28 + i, "N") = y
Cells(28 + i, "O") = Z
Next Row
Set SimulatedValues = Range(Range("M29"), Cells(28 + SampleSize, "M"))
End Sub