#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 69
Default Help to create this

Hi. I need help to create this:

I've got my actual view like this: (Rows)
ID DInicio DFim
3000 38279 38340
3000 38353 38561
3000 38578 38927

and I need to make it look like this: (one reocord, columns)
ID DInicio DFim DInicio DFim DInicio DFim
3000 38279 38340 38353 38561 38578 38927


Please help me out here.

Regards in advance.
Marco
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Help to create this

Presumably you have multiple ID's.

do they all have the same number of rows?

If you only have a limited number of rows per ID, but they don't all have
the same number of rows.. something like this...

In D4,

=if($A3=$A2,B3,"")

and D5 would be

=if($A3=$A2,B4,"")

Then, copy this If statement DOWN the max number of rows you'd need.

then, either use OFFSET() or cut and paste the values across your first row.

Once done, copy and paste these fornulas down your rows.

then...

to the far right of row 2, do.. =if(A2=A1,"X","")

paste all the way down..

Copy and paste special all rows as values.

put a filter on, and delete any row with an X in that last column to remove
dups.

"Marco" wrote:

Hi. I need help to create this:

I've got my actual view like this: (Rows)
ID DInicio DFim
3000 38279 38340
3000 38353 38561
3000 38578 38927

and I need to make it look like this: (one reocord, columns)
ID DInicio DFim DInicio DFim DInicio DFim
3000 38279 38340 38353 38561 38578 38927


Please help me out here.

Regards in advance.
Marco

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Help to create this

This should do it for you.

Sub lineemup()
Dim i, lc1, lc2 As Long

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Cells.WrapText = False

For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1

If Cells(i - 1, 1) = Cells(i, 1) Then
lc1 = Cells(i - 1, Columns.Count).End(xlToLeft).Column + 1
lc2 = Cells(i, Columns.Count).End(xlToLeft).Column
Cells(i, 2).Resize(1, lc2).Copy Cells(i - 1, lc1)
Rows(i).Delete
End If

Next

Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Marco" wrote in message
...
Hi. I need help to create this:

I've got my actual view like this: (Rows)
ID DInicio DFim
3000 38279 38340
3000 38353 38561
3000 38578 38927

and I need to make it look like this: (one reocord, columns)
ID DInicio DFim DInicio DFim DInicio DFim
3000 38279 38340 38353 38561 38578 38927


Please help me out here.

Regards in advance.
Marco


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 69
Default Help to create this

It's simply great.

Are you a genius?


Thank you very much.
Marco





"Don Guillett" wrote:

This should do it for you.

Sub lineemup()
Dim i, lc1, lc2 As Long

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Cells.WrapText = False

For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1

If Cells(i - 1, 1) = Cells(i, 1) Then
lc1 = Cells(i - 1, Columns.Count).End(xlToLeft).Column + 1
lc2 = Cells(i, Columns.Count).End(xlToLeft).Column
Cells(i, 2).Resize(1, lc2).Copy Cells(i - 1, lc1)
Rows(i).Delete
End If

Next

Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Marco" wrote in message
...
Hi. I need help to create this:

I've got my actual view like this: (Rows)
ID DInicio DFim
3000 38279 38340
3000 38353 38561
3000 38578 38927

and I need to make it look like this: (one reocord, columns)
ID DInicio DFim DInicio DFim DInicio DFim
3000 38279 38340 38353 38561 38578 38927


Please help me out here.

Regards in advance.
Marco



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 69
Default Help to create this

That's way we love our wifes so much. for the support they give us.

By thhe way, this code doesn't work in Excel 2007. The pc hangs.

It works perfect in 2003

Ciao.
Marco



"Don Guillett" wrote:


Of course, everyone says so..... Well, at least my wife..
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Marco" wrote in message
...
It's simply great.

Are you a genius?


Thank you very much.
Marco





"Don Guillett" wrote:

This should do it for you.

Sub lineemup()
Dim i, lc1, lc2 As Long

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Cells.WrapText = False

For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1

If Cells(i - 1, 1) = Cells(i, 1) Then
lc1 = Cells(i - 1, Columns.Count).End(xlToLeft).Column + 1
lc2 = Cells(i, Columns.Count).End(xlToLeft).Column
Cells(i, 2).Resize(1, lc2).Copy Cells(i - 1, lc1)
Rows(i).Delete
End If

Next

Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Marco" wrote in message
...
Hi. I need help to create this:

I've got my actual view like this: (Rows)
ID DInicio DFim
3000 38279 38340
3000 38353 38561
3000 38578 38927

and I need to make it look like this: (one reocord, columns)
ID DInicio DFim DInicio DFim DInicio DFim
3000 38279 38340 38353 38561 38578 38927


Please help me out here.

Regards in advance.
Marco




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Help to create this


I just tested in xl2007 thinking that maybe it didn't work if in a sheet
module. Worked fine in both a regular module and from a sheet module. I
can't think of a reason why you had a problem but it is NOT the code.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Marco" wrote in message
...
That's way we love our wifes so much. for the support they give us.

By thhe way, this code doesn't work in Excel 2007. The pc hangs.

It works perfect in 2003

Ciao.
Marco



"Don Guillett" wrote:


Of course, everyone says so..... Well, at least my wife..
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Marco" wrote in message
...
It's simply great.

Are you a genius?


Thank you very much.
Marco





"Don Guillett" wrote:

This should do it for you.

Sub lineemup()
Dim i, lc1, lc2 As Long

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Cells.WrapText = False

For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1

If Cells(i - 1, 1) = Cells(i, 1) Then
lc1 = Cells(i - 1, Columns.Count).End(xlToLeft).Column + 1
lc2 = Cells(i, Columns.Count).End(xlToLeft).Column
Cells(i, 2).Resize(1, lc2).Copy Cells(i - 1, lc1)
Rows(i).Delete
End If

Next

Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Marco" wrote in message
...
Hi. I need help to create this:

I've got my actual view like this: (Rows)
ID DInicio DFim
3000 38279 38340
3000 38353 38561
3000 38578 38927

and I need to make it look like this: (one reocord, columns)
ID DInicio DFim DInicio DFim DInicio DFim
3000 38279 38340 38353 38561 38578 38927


Please help me out here.

Regards in advance.
Marco





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
How to create adress list so can mail merge and create labels? adecocq Excel Discussion (Misc queries) 2 October 25th 06 12:32 AM
how to create a combo box in excel - how to create the drop down . @evy Excel Discussion (Misc queries) 2 August 18th 06 12:17 PM
How to create a form to insert a hyerlink.VBA code to create a for karthi Excel Discussion (Misc queries) 0 July 5th 06 11:26 AM
Create dictionary of terms, create first time user site Solitaire Jane Austin New Users to Excel 1 January 19th 06 09:47 PM
need to create a formula to create a timesheet but haven't a clue AHurd Excel Discussion (Misc queries) 7 August 22nd 05 12:04 PM


All times are GMT +1. The time now is 11:50 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"