Trying to create a macro

C

Chuck

I have a number in A1 and a range from b1 thru b10. I want to create a
macro that copies that range to I2, paste special transposing so it is in I2
thru R2 and then goes back and copies b1 thru b10 again and pastes special
with transpose to I3 thru R3 and repeats until it gets to the number that is
in A1. I've tried to do a macro record but I can't seem to get it to work.

Any help would be appreciated.


Chuck C
 
D

Dale Hymel

Name Cell A1 Counter
Name Cell B1:B10 Data


Sub Macro1()
Dim intCounter As Integer
intCounter = Range("Counter").Value

Range("Data").Copy
For x = 1 To intCounter
Range("I1").Offset(x, 0).PasteSpecial Paste:=xlAll, Operation:=xlNone,
SkipBlanks:=False,Transpose:=True
Next x

End Sub
 
C

Chuck

Thanks for the feedback.
I tried the macro and got a compile error in the line that starts out with
Range("I1"), It wasn't a typo because I just cut and pasted.
 
G

Gord Dibben

Chuck

That line and the next one should be one continuous line.

OR place a continuation mark _

Range("I1").Offset(x, 0).PasteSpecial Paste:=xlAll, Operation:=xlNone, _
SkipBlanks:=False,Transpose:=True

Note <space> before the _

Gord Dibben XL2002
 
C

Chuck

That was it, thanks for the help.

Chuck

That line and the next one should be one continuous line.

OR place a continuation mark _

Range("I1").Offset(x, 0).PasteSpecial Paste:=xlAll, Operation:=xlNone, _
SkipBlanks:=False,Transpose:=True

Note <space> before the _

Gord Dibben XL2002
 
D

Dale Hymel

This should all be one line


Range("I1").Offset(x, 0).PasteSpecial Paste:=xlAll,
Operation:=xlNone,SkipBlanks:=False,Transpose:=True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top