Beginning Macro User

glebbaser

New Member
Joined
Jun 9, 2021
Messages
7
Hello - I've been trying to track down an answer via the internet, but haven't been able to quite find what I'm looking for. Hoping someone here can help as I'm very far from being an Excel expert.

Trying to create a macro that does the following:

1) On spreadsheet page "Combo", copy values from B5:H5
2) On separate spreadsheet page "Sim", paste values into Cells AQ12:AQ18
3) Copy values in cells AR3:AR4 in spreadsheet "Sim"
4) Paste them into cells J:4 & K4 in spreadsheet "Combo"

Repeat for all remaining rows, pasting the values in J:4 and K4 into the next row below.

Totally lost at this point.
 
So, you're doing this ONE at a time to trigger the other calculations...is that right?

Is this a homework assignment?
No, it's not a homework assignment. A study was performed and I'm running some calculations for work.

Currently, I'm doing this one at a time to trigger the other calculations. Copying the first bit of data, pasting it into the other tab, which then gives me the percents, which I'm copying and pasting back into the original tab.
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
How about this?

Code:
Sub glebbaser()
Dim lr As Long, i As Long
lr = Sheets("Combo").Cells(Rows.Count, "B").End(xlUp).Row
For i = 3 To lr
Sheets("Combo").Range("B" & i & ":H" & i).Copy
Sheets("Sim").Range("AQ12:AQ18").PasteSpecial Transpose:=True
Sheets("Sim").Range("AR3:AR4").Calculate
Sheets("Combo").Range("J" & i).Value = Sheets("Sim").Range("AR3").Value
Sheets("Combo").Range("K" & i).Value = Sheets("Sim").Range("AR4").Value
Next i
End Sub
 
Upvote 0
Solution
How about this?

Code:
Sub glebbaser()
Dim lr As Long, i As Long
lr = Sheets("Combo").Cells(Rows.Count, "B").End(xlUp).Row
For i = 3 To lr
Sheets("Combo").Range("B" & i & ":H" & i).Copy
Sheets("Sim").Range("AQ12:AQ18").PasteSpecial Transpose:=True
Sheets("Sim").Range("AR3:AR4").Calculate
Sheets("Combo").Range("J" & i).Value = Sheets("Sim").Range("AR3").Value
Sheets("Combo").Range("K" & i).Value = Sheets("Sim").Range("AR4").Value
Next i
End Sub
Thank you! Thank you! Thank you!
 
Upvote 0

Forum statistics

Threads
1,214,392
Messages
6,119,257
Members
448,880
Latest member
aveternik

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