ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   easy macro problem (https://www.excelbanter.com/excel-programming/362938-easy-macro-problem.html)

theintern

easy macro problem
 

I'm not an avid user of excel, which will explain the problem I'm
having.

What I want to do:
Take 1 very long column of data, paste it into a new sheet, and split
this one big column into 50 columns of 13 rows each.

I did this once, using relative cell referencing, and I tried to use
the macro and kept getting an error. Whats the problem?


--
theintern
------------------------------------------------------------------------
theintern's Profile: http://www.excelforum.com/member.php...o&userid=34980
View this thread: http://www.excelforum.com/showthread...hreadid=547183


Bob Phillips

easy macro problem
 

iCol = 1
j=0
For i = 1 To Cells(Rows.Count,"A").End(xlUp).Row
j = j + 1
Worksheets("Sheet2").Cells(j, iCol).Value = Cells(i,"A").Value
If i Mod 13 = 0 Then
j = 0
iCol = iCol + 1
End If
Next i

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"theintern" wrote
in message ...

I'm not an avid user of excel, which will explain the problem I'm
having.

What I want to do:
Take 1 very long column of data, paste it into a new sheet, and split
this one big column into 50 columns of 13 rows each.

I did this once, using relative cell referencing, and I tried to use
the macro and kept getting an error. Whats the problem?


--
theintern
------------------------------------------------------------------------
theintern's Profile:

http://www.excelforum.com/member.php...o&userid=34980
View this thread: http://www.excelforum.com/showthread...hreadid=547183





All times are GMT +1. The time now is 08:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com