Repeat Macro Transpose

joyousrob

Board Regular
Joined
Nov 12, 2014
Messages
56
Hey guys , so I got this macro below but I want to introduce a loop or some way for it to repeat itself 13 times, i ave got a range that I coy and then paste transposed.

Any ideas ?

Sub Macro35()
'
' Macro35 Macro
'


'
Range("B18:F20").Select
Selection.Copy

Range("B64").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True

Range("B22:F24").Select
Application.CutCopyMode = False
Selection.Copy

Range("B71").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
End Sub
 
Ok Rick, Ill show you what Im working with hope it helps describe what I want to do,

THis is the table i have:

CompanyYearSalesXfactorYfactor
11137749
12194550
13988686
21438937
2221268
23491187
31293319
321555100
33897476
4125730
42441116
43676970
51111699
5233953
5395644
61215377
62272316
63852774
71745415
7285541
7335357
816215
82208222
83835668
91342956
92999639
93455247
101265873
102613447
1037598
111481484
112459556
113461983

<tbody>
</tbody>


And I want it to do the next thing .... which is copy and paste transposing for every company ( you are right it is 11), so i would have 11 of these below

111
123
131998
774586
495086
222
123
432149
892611
37887

<tbody>
</tbody>

The text "company" is in cell B17 company number 1 is in B18 and there is a blank cell between the values for each company. so between company 1 and 2 a blank row between company 2 and 3 another blank row etc...
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
(copied above is all the info on that macro i might be missing some formating on it ) but it only copied it once
Hiya
When you said this did you men that the macro only copied once, or that when you RAN the macro only range B18:F20 was copied?
 
Upvote 0
And I want it to do the next thing .... which is copy and paste transposing for every company ( you are right it is 11), so i would have 11 of these below

The text "company" is in cell B17 company number 1 is in B18 and there is a blank cell between the values for each company. so between company 1 and 2 a blank row between company 2 and 3 another blank row etc...
Given what you have posted, either modified code that Joe4 posted in Message #9 should work for you. Did they? Or are you still having trouble? If so, explain, in detail, what that trouble is.
 
Upvote 0

Forum statistics

Threads
1,215,950
Messages
6,127,897
Members
449,411
Latest member
AppellatePerson

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