Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Brisbane Rob
 
Posts: n/a
Default Transposition impossibility?


When I import my inventory records from the accounting package this is
what I have:-

Code Size
1 3
1 6
1 7
2 2
2 3
2 4
2 6
3 4
4 1
4 3

You get the picture - twelve pages of codes with different sizes.
This is what I need:-

Code Sizes
1 3 6 7
2 2 3 4 6
3 4
4 1 3

With a random number of lines being reported for the sizes for the
product codes, I can't figure out a way to run a copypaste
specialtranspose macro because doing it manually sucks.

It would be best if the sizes went into different columns so I could
run further analysis but any ideas gratefully accepted.


--
Brisbane Rob
------------------------------------------------------------------------
Brisbane Rob's Profile: http://www.excelforum.com/member.php...o&userid=25096
View this thread: http://www.excelforum.com/showthread...hreadid=537553

  #2   Report Post  
Posted to microsoft.public.excel.misc
Brisbane Rob
 
Posts: n/a
Default Transposition impossibility?


My layout lost its formatting when I submitted it - the data comes into
Excel in two columns, code and size.


--
Brisbane Rob
------------------------------------------------------------------------
Brisbane Rob's Profile: http://www.excelforum.com/member.php...o&userid=25096
View this thread: http://www.excelforum.com/showthread...hreadid=537553

  #3   Report Post  
Posted to microsoft.public.excel.misc
Stefan
 
Posts: n/a
Default Transposition impossibility?

With a random number of lines being reported for the sizes for the
product codes, I can't figure out a way to run a copypaste
specialtranspose macro because doing it manually sucks.


It would be best if the sizes went into different columns so I could
run further analysis but any ideas gratefully accepted.


Rob,

you can run this code

Sub transform()
Set b = Worksheets("Sheet1") '< change name if needed
iRow = Application.CountA(Columns(1))
xRow = 1
xCol = 5
For i = 2 To iRow
If Cells(i, 1) < Cells(i - 1, 1) Then
xRow = xRow + 1: xCol = 5
Cells(xRow, 4) = Cells(i, 1)
End If
Cells(xRow, xCol) = Cells(i, 2)
xCol = xCol + 1
Next
End Sub


This is if your list is in column A:B and starts from the top.
The result comes in column D: ...

--
Stefan
  #4   Report Post  
Posted to microsoft.public.excel.misc
Stefan
 
Posts: n/a
Default Transposition impossibility?

" Rob,

you can run this code

Sub transform()
Set b = Worksheets("Sheet1") '< change name if needed
iRow = Application.CountA(Columns(1))
xRow = 1
xCol = 5
For i = 2 To iRow
If Cells(i, 1) < Cells(i - 1, 1) Then
xRow = xRow + 1: xCol = 5
Cells(xRow, 4) = Cells(i, 1)
End If
Cells(xRow, xCol) = Cells(i, 2)
xCol = xCol + 1
Next
End Sub


This is if your list is in column A:B and starts from the top.
The result comes in column D: ...

--
Stefan



Sorry, first line (set b= ...) isn't necessary if the sheet is visible on
your screen; otherwise you must add b. before every Cells in the code.

Cells(... = b.Cells(...
  #5   Report Post  
Posted to microsoft.public.excel.misc
Brisbane Rob
 
Posts: n/a
Default Transposition impossibility?


Many thanks Stephan. It works brilliantly...


--
Brisbane Rob
------------------------------------------------------------------------
Brisbane Rob's Profile: http://www.excelforum.com/member.php...o&userid=25096
View this thread: http://www.excelforum.com/showthread...hreadid=537553

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
Impossibility? jsc3489 Excel Worksheet Functions 7 August 3rd 05 05:54 PM
Transposition Kuna&Zagiel Excel Worksheet Functions 2 January 7th 05 12:06 PM


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