Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default Text to column and paste special transpose

Hi All,

I have 1 table like this


item_number qty ref
00010-001 3 U34,U36,U43
00013-001 2 U16,U21
12505-001 3 U32,U33,U42
12512-001 3 U5,U6,U27

and 1 want it to become like this

item_number qty ref
00010-001 3 U34
00010-001 3 U36
00010-001 3 U43
00013-001 2 U16
00013-001 2 U21
12505-001 3 U32
12505-001 3 U33
12505-001 3 U42
12512-001 3 U5
12512-001 3 U6
12512-001 3 U27

Anybody can help me to program it in macro.. usually i do it manually and have to redo again do to careless.


  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 621
Default Text to column and paste special transpose

After using Text to Columns on Column C.......comma
delimited.........Run the Reorganize macro.

Sub ReOrganize()
Dim LR As Long, I As Long, r As Long, c As Long, v As Long
Application.ScreenUpdating = False
LR = Range("A" & Rows.Count).End(xlUp).Row
I = 2
Do Until Range("A" & I) = ""
If Range("C" & I) < "" Then
c = Cells(I, Columns.Count).End(xlToLeft).Column
v = I
For r = 3 To c
I = I + 1
Rows(I).Insert xlShiftDown
Range("A" & I) = Range("A" & I - 1)
Range("C" & I) = Cells(v, r)
Next r
End If
I = I + 1
Loop
Range("D1", Cells(Rows.Count, Columns.Count)).ClearContents
Call Fill_Blanks
Application.ScreenUpdating = True
End Sub

Sub Fill_Blanks()
Dim wks As Worksheet
Dim rng As Range
Dim lastrow As Long
Dim Col As Long
Set wks = ActiveSheet
With wks
Col = .Range("B1").Column
Set rng = .UsedRange
lastrow = .Cells.SpecialCells(xlCellTypeLastCell).Row
Set rng = Nothing
On Error Resume Next
Set rng = .Range(.Cells(2, Col), .Cells(lastrow, Col)) _
.Cells.SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "No blanks found"
Exit Sub
Else
rng.NumberFormat = "General"
rng.FormulaR1C1 = "=R[-1]C"
End If
With .Cells(1, Col).EntireColumn
.Value = .Value
End With
End With
End Sub


Gord

On Sat, 31 Mar 2012 02:06:45 GMT, isfaruddin sapardi
wrote:

Hi All,

I have 1 table like this


item_number qty ref
00010-001 3 U34,U36,U43
00013-001 2 U16,U21
12505-001 3 U32,U33,U42
12512-001 3 U5,U6,U27

and 1 want it to become like this

item_number qty ref
00010-001 3 U34
00010-001 3 U36
00010-001 3 U43
00013-001 2 U16
00013-001 2 U21
12505-001 3 U32
12505-001 3 U33
12505-001 3 U42
12512-001 3 U5
12512-001 3 U6
12512-001 3 U27

Anybody can help me to program it in macro.. usually i do it manually and have to redo again do to careless.

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
Transpose, Paste Special idgity Excel Discussion (Misc queries) 2 September 6th 07 06:04 PM
Paste Special / transpose Ron Carr Excel Discussion (Misc queries) 2 February 24th 06 06:13 PM
When I special paste and transpose.... sml New Users to Excel 4 January 12th 06 12:49 AM
Paste Special Transpose Brian Excel Programming 1 August 29th 05 03:43 PM
Need help with Transpose paste special Paul Excel Programming 4 December 5th 04 10:00 PM


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