Hi All,
I have two columns with data as follows:
Column A:
Shoe white
Shoe Black
shoe Red
Column B:
Size 6
Size 7
Size 8
Size 9
Size 10
I need to combine (concatenate) them as follows:
Shoe white Size 6
Shoe white Size 7
Shoe white Size 8
Shoe white Size 9
Shoe white Size 10
Shoe Black Size 6
Shoe Black Size 7
Shoe Black Size 8
Shoe Black Size 9
Shoe Black Size 10
shoe Red Size 6
shoe Red Size 7
shoe Red Size 8
shoe Red Size 9
shoe Red Size 10
I tried the following code:
Sub proCombineUnevenColumnsVariables()
I have a couple of problems I would appreciate some help with:![]()
x = 1 ThisWorkbook.Activate Sheets("Combining_values").Select Do While Cells(x, 17).Value <> " " Cells(x, 1).Value = Cells(x, 16).Value & " " & Cells(x, 17).Value 'Range("A" & x & ":A" & x + 1).Merge x = x + 1 Loop End Sub
1.The code above gets a Run-time error:'13' Type Mismatch" error message. Besides the loop never ends, it executes even for empty cells (which is against the condition of the While loop) and I have to re-start excel to get out of it.
2. The code above only solves one part of the problem (it merges 2 ranges) but I still need to work out how to nest it with another loop to concatenate each cell of one range with ALL CELLS of the other range.
I would appreciate if someone could point me in the right direction.
you all have a lovely day.
Cheers,
Juan
Bookmarks