#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Need a Macro

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 587
Default Need a Macro

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

--
isabelle

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Need a Macro

Thanks you, that did the trick..
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"