Entering values in a list into a macro

Setofskills

New Member
Joined
Aug 17, 2015
Messages
9
I have a macro that will run through a computation given two inputs on the main tab. I'd like make a matrix in a new tab with all of variable A entries across the top row and the variable B entries down the side column. I'm trying to make nested For loops to run the macro through all the possibilities and enter the resulting values in the matrix. This is proving to be outside of my abilities, any help would be greatly appreciated.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I have a macro that will run through a computation given two inputs on the main tab. I'd like make a matrix in a new tab with all of variable A entries across the top row and the variable B entries down the side column. I'm trying to make nested For loops to run the macro through all the possibilities and enter the resulting values in the matrix. This is proving to be outside of my abilities, any help would be greatly appreciated.

I asked too soon, I solved it with a modified version of below:

Dim r As Integer
Dim c As Integer

For r = 1 To 6

For c = 1 To 30

Worksheets("Summary").Range("a1").Value = Worksheets("Matrix").Range("c2").Offset(0, c - 1).Value
Worksheets("Summary").Range("a2").Value = Worksheets("Matrix").Range("b3").Offset(r - 1, 0).Value
Calculate
Worksheets("Matrix").Range("c3").Offset(r - 1, c - 1).Value = Worksheets("Summary").Range("g41").Value
'could be h if adjusted value was desired

Next c

Next r
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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