Trying to create a macro

  • Thread starter Thread starter Chuck
  • Start date Start date
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
 
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
 
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.
 
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
 
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
 
This should all be one line


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