Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default One Entry to Multiple Rows

I have data that looks like this:
X1 | Y1 Y2 Y3 Y4
X2 | Y4 Y5 Y6 Y7

And I need to get to:
X1 | Y1
X1 | Y2
X1 | Y3
X1 | Y4
X2 | Y4
...... etc.

I can change the 2nd row's entries to more columns, but that doesn't seem to
get me much closer to the needed format (and there are thousands of lines so
I'd rather not do it manually). Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default One Entry to Multiple Rows

should do it. change mc to suit
'=====
Option Explicit
Sub lineemup()
Dim mc As Long
Dim mr As Long
Dim i As Long
Dim lc As Long

mc = 3 'col c
mr = 1
For i = 1 To Cells(Rows.Count, mc).End(xlUp).Row
lc = Cells(i, Columns.Count). _
End(xlToLeft).Column - mc
Cells(i, mc).Resize(, lc).Copy
Cells(mr, mc - 1).PasteSpecial _
Paste:=xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=True
mr = mr + lc
Next i
Application.CutCopyMode = False
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Pandaura" wrote in message
...
I have data that looks like this:
X1 | Y1 Y2 Y3 Y4
X2 | Y4 Y5 Y6 Y7

And I need to get to:
X1 | Y1
X1 | Y2
X1 | Y3
X1 | Y4
X2 | Y4
..... etc.

I can change the 2nd row's entries to more columns, but that doesn't seem
to
get me much closer to the needed format (and there are thousands of lines
so
I'd rather not do it manually). Any ideas?


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
Multiple data entry with multiple results Jafferi[_2_] Excel Worksheet Functions 2 March 27th 09 05:06 AM
Data entry on filtered rows. Lisa954 Excel Worksheet Functions 4 March 9th 09 11:52 PM
Inserting rows between each entry Brablo Excel Discussion (Misc queries) 2 September 13th 06 11:33 PM
page set up with blank rows between each entry Sandoria New Users to Excel 3 May 17th 06 12:18 AM
Sorting with Multiple Rows per Entry Andrew Roberts Excel Worksheet Functions 12 February 25th 06 05:14 AM


All times are GMT +1. The time now is 02:33 AM.

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"