Copying solved values to a new worksheet

KevinZ

New Member
Joined
Apr 14, 2019
Messages
33
I am maximizing a value ($L$4) by changing the values in ($A$2:$A$134), value changed from 0 to 1 and limiting to only 6 records being chosen. I want to copy a specific cell (Column C) for each of these and place it in a row in the new spreadsheet. Output would look like this

<colgroup><col width="64" style="width:48pt" span="6"></colgroup><tbody>
</tbody>
124720091247201012472011124720121247201312472014

<colgroup><col width="64" style="width:48pt" span="6"> </colgroup><tbody>
</tbody>

My current code copies all 134 values and places them in a column.


Dim List_Current_row As Long

List_Current_row = Worksheets("Export").Cells(Rows.Count, 1).End(xlUp).Row + 1

If i = 0 Then
Worksheets("Export").Cells(List_Current_row, 1).Resize(1, 6).Value = _Worksheets("Parameters").Range("C2:C201").Value
Else
Worksheets("Export").Cells(List_Current_row, 1).Resize(200, 1).Value = _ Worksheets("Parameters").Range("C2:C201").Value
End If



Any ideas on what I am doing wrong? Any help is appreciated.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I wish I can see data on your Sheet. I see your code wrong at Resize 6 column, but [C2:C201] is row not column. You need use formula Transpose to change Row-Column. With code:
x.Resize(1,6) = WorksheetFunction.Transpose(Worksheets("Parameters").Range("C2:C201"))

If you need
detail it, you would use { For i = [C2].row to [C201].row } to do that.
 
Upvote 0
I am maximizing the value from Column F with constraints on column D. When solved for 6 values, the 0 in column A is changed from 0 to 1 for the 6 records. I want to take the corresponding number from Column C and place them on a new spreadsheet as referenced above.

I changed the code as suggested but I am getting a Runtime error 438 message on the new line.

Let me know if there is anything else you need to see.

Column AColumn CColumn DColumn F
01247200111600227
01247200211300152
01247200310900243
01247200410400218
01247200510000244
0124720069700219
0124720079500105
0124720089400200
0124720099300220

<colgroup><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
Forgetting macros a little, you could explain what data you have and what you expect as a result, explain with step-by-step examples what you want to maximize.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,957
Latest member
Hat4Life

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