Macro / formula help please

DebbyG

Board Regular
Joined
Jun 8, 2004
Messages
110
I have a large series of data which I need to transpose from 2 x columns to rows.

This data is in blocks of 35 rows each.

Can someone tell me please how to write a Macro which will copy the next sequence of 35 rows (3 blank rows are skipped between each set of data) and transposer into a new spreadsheet.

I have tried copying a formula but cannot get it to accept a sequence of 35 rows.

many thanks
:pray:
 

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.
Re: Macro / formula range help please

I have figured out the below, but I have to freetype the Range to paste from and the Range to paste to (i.e. B534:B571) & (A17)

Can anyone let me have a formula to increase each range by 37 rows and paste into the next blank row.

I need to go up to range B19192:B19229 - hence needing your help please.

Many thanks


:pray:

Range("B534:B571").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.ActivateNext
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Range("A17").Select
ActiveWindow.ActivateNext


Range("B572:B609").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.ActivateNext
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Range("A18").Select
ActiveWindow.ActivateNext

Range("B610:B647").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.ActivateNext
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Range("A19").Select
ActiveWindow.ActivateNext
 
Upvote 0
Hi DebbyG,

Is this what you are looking for?


Dim iRow As Long
Dim ToRow As Long

ToRow = 17

For iRow = 534 To 19192 Step 38

Range(Cells(iRow,2),Cells(iRow+37,2).Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.ActivateNext
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Cells(ToRow,1).Select
ActiveWindow.ActivateNext

ToRow = ToRow + 1

Next iRow



Damon
 
Upvote 0
Thank You

However I am having problems with the following

Range(Cells(iRow,2),Cells(iRow+37,2).Select

I have insert another ")" after (iRow,2) but I am getting an error message saying

Compile Error - Invalid use of Property.

Can anyone help please.

Many thanks
 
Upvote 0
Hi again DebbyG,

Yes, I goofed and forgot the closing right parenthesis. But it needs to be at the end of the Range statement, like this:

Range(Cells(iRow,2),Cells(iRow+37,2)).Select

Damon
 
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,558
Members
449,038
Latest member
Guest1337

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