A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help to create this



 
 
Thread Tools Display Modes
  #1  
Old May 18th, 2009, 02:49 PM posted to microsoft.public.excel.misc
Marco
external usenet poster
 
Posts: 535
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  
Old May 18th, 2009, 03:14 PM posted to microsoft.public.excel.misc
Sean Timmons
external usenet poster
 
Posts: 1,722
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  
Old May 18th, 2009, 03:16 PM posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
 
Posts: 6,167
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  
Old May 18th, 2009, 06:38 PM posted to microsoft.public.excel.misc
Marco
external usenet poster
 
Posts: 535
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



  #5  
Old May 18th, 2009, 08:23 PM posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
 
Posts: 6,167
Default Help to create this


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




  #6  
Old May 19th, 2009, 11:13 AM posted to microsoft.public.excel.misc
Marco
external usenet poster
 
Posts: 535
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  
Old May 19th, 2009, 01:44 PM posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
 
Posts: 6,167
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





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:57 PM.


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