Sorting

O

osaka78

i have around 20 sheets each one has a following data
A B C D E F
1 5 6 7 8 9 abc
2 6 5 8 8 9 def
3 8 7 9 2 1 ghi
4 7 7 6 6 5 jkl
5 5 4 1 1 1 mno

i like the result to be converted as follows

abc 5
abc 6
abc 7
abc 8
abc 9
def 6
def 5
def 8
def 8
def 9
and so on

Regards
 
G

Greg Wilson

This works according to my read of your situation. It puts the transformed
data in column G. Assumed is that your data starts in A1 and ranges A to F
and down an indefinite number of rows. Change to suit. After creating the new
data you can confirm that it's OK and delete the original. Then paste it in
its place.

Test it rigorously on experimental data. Written and tested in 10 minutes!!!

Sub TransformData()
Dim r As Range
Dim i As Long, ii As Long, x As Long
Set r = Range(Range("A1"), Range("A1").End(xlDown))
For i = 1 To r.Count
For ii = 1 To 5
x = x + 1
r(x, 7).Value = r(i, 6) & r(i, ii).Value
Next
Next
End Sub

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SEARCH IN SUMPRODUCT 8
Rank If? 3
collapse rows into one 2
rearranging formula suggestion 2
lookup with IF criteria 2
SUMIF based on data in adjacent row 6
Formula Length 4
WCG Stats Sunday 01 October 2023 3

Top