Need a Macro

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?
 
I

isabelle

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
 

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