First of all, I want to thank the people that has helped me with their codes.
I posted before with a problem, that despite the codes received I still can't find solution.
I was looking for someone that could help me with a code that does this to my excel data:
From:
RA | 21 | 32 | 21 | (blank)|
RA | 12 | 23 | 45 | (blank)|
EN | 18 | 15 | 20 | (blank)|
EN | 23 | 34 | 21 | (blank)|
HS | 14 | 15 | 16 | (blank)|
HS | 13 | 12 | 11 | (blank)|
To:
RA | 21 | 32 | 21 | EN | 18 | 15 | 20 |
RA | 12 | 23 | 45 | EN | 23 | 34 | 21 |
HS | 14 | 15 | 16 |
HS | 13 | 12 | 11 |
End then To:
RA | 21 | 32 | 21 | EN | 18 | 15 | 20 | HS | 14 | 15 | 16 |
RA | 12 | 23 | 45 | EN | 23 | 34 | 21 | HS | 13 | 12 | 11 |
Someone has given me this code (which I thank him for it)
Sub Test()
Dim Sh As Worksheet
Dim Col As Long
Dim RowFrom As Long
Dim RowTo As Long
Set Sh = Worksheets("Sheet1")
Col = Sh.Cells(1, Sh.Columns.Count).End(xlToLeft).Column + 1
RowFrom = 1
RowTo = 1
With Sh
Do
If IsEmpty(.Cells(RowFrom, 1)) Then Exit Sub
If .Cells(RowFrom, 1).Value = "EN" Then
With .Range(.Cells(RowFrom, 1), .Cells(RowFrom, Col - 1))
.Copy Sh.Cells(RowTo, Col)
.Delete Shift:=xlUp
RowTo = RowTo + 1
End With
Else
RowFrom = RowFrom + 1
End If
Loop
End With
End Sub
Which solves my problem when there is not so much data (I think).
But my excel sheet has thousands of entries, so when I run it in my excel sheet, the program starts running indefinitely and it seems it will never stop.
So this time I'm attaching part of my excel sheet (with only hundreds cells of data). In this case the code works, but its output it's not what I need exactly, and again, I need it to work for thounsands of entries.
If someone can assist me, check my file attached, and help me with this issue I thank you all in advance.
Regards,
Victor
Bookmarks