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.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Welcome to Mr. Excel,

Try this:

Code:
Sub glebbaser()
Sheets("Combo").Range("B5:H5").Copy
Sheets("Sim").Range("AQ12:AQ18").PasteSpecial Transpose:=True
Sheets("Sim").Range("AR3:AR4").Copy
Sheets("Combo").Range("J4:K4").PasteSpecial Transpose:=True
End Sub

What do you mean "repeat for all remaining rows" ?
Where do you start and where do you end?
 
Upvote 0
Welcome to Mr. Excel,

Try this:

Code:
Sub glebbaser()
Sheets("Combo").Range("B5:H5").Copy
Sheets("Sim").Range("AQ12:AQ18").PasteSpecial Transpose:=True
Sheets("Sim").Range("AR3:AR4").Copy
Sheets("Combo").Range("J4:K4").PasteSpecial Transpose:=True
End Sub

What do you mean "repeat for all remaining rows" ?
Where do you start and where do you end?
The first row is Row 5 and last row is 21602
 
Upvote 0
So, do you want the range B5 to H5 and down to B21602 to H21602 copied where?
 
Upvote 0
So, do you want the range B5 to H5 and down to B21602 to H21602 copied where?

My goal is to have a macro that replicates steps 1-4 for columns J5:J21602 and K5:K21602


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.
 
Upvote 0
BTW: you can't copy 21598 rows into that many columns. Excel will only support 16384 columns.
 
Upvote 0
BTW: you can't copy 21698 rows into that many columns. Excel will only support 16384 columns.
I'm sorry. I meant rows. Column J and Column K have 21,698 rows. I need the macro to provide a value for rows J5:J21602 and K5:K21602
 
Upvote 0
Start this again: you want the rows in Combo from B5 to H21602 [that's 21598 rows] to be copied to Sim in the respective J to K columns?
That doesn't make sense because you're coping from a range of 7 columns to 2 columns. You can't transpose the original and paste it because, as i said, there's a limit on the columns.

Or do you now NOT mean the B to H columns, but J and K from Combo to J and K to Sim?
 
Upvote 0
Start this again: you want the rows in Combo from B5 to H21602 [that's 21598 rows] to be copied to Sim in the respective J to K columns?
That doesn't make sense because you're coping from a range of 7 columns to 2 columns. You can't transpose the original and paste it because, as i said, there's a limit on the columns.

Or do you now NOT mean the B to H columns, but J and K from Combo to J and K to Sim?
Hopefully this quick video will explain it better than I can: https://share.getcloudapp.com/o0ueg91d
 
Upvote 0
So, you're doing this ONE at a time to trigger the other calculations...is that right?

Is this a homework assignment?
 
Upvote 0

Forum statistics

Threads
1,215,214
Messages
6,123,664
Members
449,114
Latest member
aides

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