Need a Macro

  • Thread starter Thread starter B~O~B
  • Start date Start date
B

B~O~B

I am using Excel 2003 and have what i call my prim col (A) and my sec
col (B:BZ).
A B C D ...
B001 X002 Y100
B002 X002 Y110 XX04

What I need to do is copy the prim to a new sheet in col "a" for each
of the sec data. NOTE: each Prim col can have 1 to 70+ related sec
col.

Should look like this:

B001 X002
B001 Y100
B002 X002
B002 Y110
B002 XX04
....

Can any one help?
 
hi,

Code:
Sub Macro1()
Dim i As Integer, y As Integer, x As Integer
For i = 1 To Sheets("Feuil1").Range("A65536").End(xlUp).Row
For y = 2 To Sheets("Feuil1").Range("IV" & i).End(xlToLeft).Column
x = x + 1
Sheets("Feuil2").Range("A" & x) = Sheets("Feuil1").Range("A" & i)
Sheets("Feuil2").Range("B" & x) = Sheets("Feuil1").Cells(i, y)
Next
Next
End Sub
 
Back
Top