vba range problem

Status
Not open for further replies.

Oscar23

New Member
Joined
Nov 29, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
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
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Duplicate to: Cannot get my Macro to run through range

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,084
Messages
6,123,029
Members
449,092
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top