Zembu
New Member
- Joined
- Apr 9, 2016
- Messages
- 27
- Office Version
- 2016
- Platform
- Windows
Hello All,
I have searched in your site for a solution for my problem, and have tried various solutions for similar questions, modifying some, but without success. I am running Excel 2003.
I have a row of cells, the whole width of the Excel display, each cell containing a formula that results in display of either a letter or nothing. Here for instance is a formula from one of these cells "=IF(V2="","",HLOOKUP(V20,$J$77:$AI$103,V2,TRUE))" The row commences with the letters, then eventually no letters, as the source for these - from elsewhere in the file runs out.
I want to have all the letters from the cells that display them concatenated into one cell. But there could be any number of letters - usually more than 30 - and the number of letters is not always the same.
Here for instance is a row of cells with letters;
<tbody>
[TD="class: xl25"]C[/TD]
[TD="class: xl25"]H[/TD]
[TD="class: xl25, width: 19"]C[/TD]
[TD="class: xl25, width: 19"]U[/TD]
[TD="class: xl25, width: 19"]C[/TD]
[TD="class: xl24, width: 19"]J[/TD]
[TD="class: xl24, width: 19"]X[/TD]
[TD="class: xl24, width: 19"]S[/TD]
[TD="class: xl24, width: 19"]Y[/TD]
[TD="class: xl24, width: 19"]D[/TD]
[TD="class: xl24, width: 19"]B[/TD]
[TD="class: xl24, width: 19"]J[/TD]
[TD="class: xl24, width: 19"]L[/TD]
[TD="class: xl24, width: 19"]F[/TD]
[TD="class: xl24, width: 19"]L[/TD]
[TD="class: xl24, width: 19"]Z[/TD]
[TD="class: xl24, width: 19"]V[/TD]
[TD="class: xl24, width: 19"]K[/TD]
[TD="class: xl24, width: 19"]I[/TD]
[TD="class: xl24, width: 19"]Y[/TD]
[TD="class: xl24, width: 19"]G[/TD]
[TD="class: xl24, width: 19"]H[/TD]
[TD="class: xl24, width: 19"]F[/TD]
[TD="class: xl24, width: 19"]G[/TD]
[TD="class: xl24, width: 19"]K[/TD]
[TD="class: xl24, width: 19"]K[/TD]
[TD="class: xl24, width: 19"]O[/TD]
[TD="class: xl24, width: 19"]T[/TD]
[TD="class: xl24, width: 19"]K[/TD]
[TD="class: xl24, width: 19"]M[/TD]
[TD="class: xl24, width: 19"]U[/TD]
[TD="class: xl24, width: 19"]D[/TD]
[TD="class: xl24, width: 19"]U[/TD]
[TD="class: xl24, width: 19"]C[/TD]
[TD="class: xl24, width: 19"]X[/TD]
[TD="class: xl24, width: 19"]P[/TD]
[TD="class: xl24, width: 19"]F[/TD]
[TD="class: xl24, width: 19"]Z[/TD]
[TD="class: xl24, width: 19"]P[/TD]
[TD="class: xl24, width: 19"]G[/TD]
[TD="class: xl24, width: 19"]E[/TD]
[TD="class: xl24, width: 19"]R[/TD]
[TD="class: xl24, width: 19"][/TD]
[TD="class: xl24, width: 19"][/TD]
[TD="class: xl24, width: 19"][/TD]
[TD="class: xl24, width: 19"][/TD]
[TD="class: xl24, width: 19"][/TD]
</tbody>
and below is an output that I can get from a Visual Basic Macro that I copied from elsewhere in this site;
<tbody>
[TD="class: xl24, colspan: 45"]C, , , , , , , , , , CHCUCJXSYDBJLFLZVKIYGHFGKKOTKMUDUCXPFZPGER, , , , , , , CHCUCXVDLCQOETXMICMNWJAHALISUJODYTRKVCHFPQHYOZMBGWYIYKJKMGVUHTPDHATEHQTVAOTZJJIPSMNBIYWJUMLKLAVHEZQNMWFLACGEHCFNEKYKVYDXLZTXUVYIHBPHCCNUZVKHDUMSFPKDTKKHVR, , , , CHCUCJXSYDBJLFLZVKIYGHFGKKOTKMUDUCXPFZPGER,[/TD]
</tbody>
There is more but I think that will do as an example.
Here is the Macro that I used and modified slightly - (thanks to hiker95);
Sub Join_UPCS()
' hiker95, 02/23/2016, ME923576
Dim lr As Long
Application.ScreenUpdating = False
lr = Cells(Rows.Count, 1).End(xlUp).Row
Range("n28").Value = Join(Application.Transpose(Range("n23:n" & lr)), ", ")
Application.ScreenUpdating = True
End Sub
You can see that the above first copies the first letter, then adds commas, then the complete text, then more commas and the rest is from the formulae that exist in the other cells, although on my screen nothing is displayed in these cells.
I tried removing the comma and space at .....Transpose(Range("n23:n" & lr)), ", ") - Thus - ...lr)), "")
This results in a string of letters, still containing an unwanted duplicate of the first, followed by all the other unwanted letters as before.
If anyone can succeed in getting a solution, a further refinement would be to add a space after every 5th letter;
e.g CHCUC JXSYD BJLFL ZVKIY GHFGK KOTKM UDUCX PFZPG ER
Many thanks to any of you who will attempt this.

I have searched in your site for a solution for my problem, and have tried various solutions for similar questions, modifying some, but without success. I am running Excel 2003.
I have a row of cells, the whole width of the Excel display, each cell containing a formula that results in display of either a letter or nothing. Here for instance is a formula from one of these cells "=IF(V2="","",HLOOKUP(V20,$J$77:$AI$103,V2,TRUE))" The row commences with the letters, then eventually no letters, as the source for these - from elsewhere in the file runs out.
I want to have all the letters from the cells that display them concatenated into one cell. But there could be any number of letters - usually more than 30 - and the number of letters is not always the same.
Here for instance is a row of cells with letters;
<tbody>
[TD="class: xl25"]C[/TD]
[TD="class: xl25"]H[/TD]
[TD="class: xl25, width: 19"]C[/TD]
[TD="class: xl25, width: 19"]U[/TD]
[TD="class: xl25, width: 19"]C[/TD]
[TD="class: xl24, width: 19"]J[/TD]
[TD="class: xl24, width: 19"]X[/TD]
[TD="class: xl24, width: 19"]S[/TD]
[TD="class: xl24, width: 19"]Y[/TD]
[TD="class: xl24, width: 19"]D[/TD]
[TD="class: xl24, width: 19"]B[/TD]
[TD="class: xl24, width: 19"]J[/TD]
[TD="class: xl24, width: 19"]L[/TD]
[TD="class: xl24, width: 19"]F[/TD]
[TD="class: xl24, width: 19"]L[/TD]
[TD="class: xl24, width: 19"]Z[/TD]
[TD="class: xl24, width: 19"]V[/TD]
[TD="class: xl24, width: 19"]K[/TD]
[TD="class: xl24, width: 19"]I[/TD]
[TD="class: xl24, width: 19"]Y[/TD]
[TD="class: xl24, width: 19"]G[/TD]
[TD="class: xl24, width: 19"]H[/TD]
[TD="class: xl24, width: 19"]F[/TD]
[TD="class: xl24, width: 19"]G[/TD]
[TD="class: xl24, width: 19"]K[/TD]
[TD="class: xl24, width: 19"]K[/TD]
[TD="class: xl24, width: 19"]O[/TD]
[TD="class: xl24, width: 19"]T[/TD]
[TD="class: xl24, width: 19"]K[/TD]
[TD="class: xl24, width: 19"]M[/TD]
[TD="class: xl24, width: 19"]U[/TD]
[TD="class: xl24, width: 19"]D[/TD]
[TD="class: xl24, width: 19"]U[/TD]
[TD="class: xl24, width: 19"]C[/TD]
[TD="class: xl24, width: 19"]X[/TD]
[TD="class: xl24, width: 19"]P[/TD]
[TD="class: xl24, width: 19"]F[/TD]
[TD="class: xl24, width: 19"]Z[/TD]
[TD="class: xl24, width: 19"]P[/TD]
[TD="class: xl24, width: 19"]G[/TD]
[TD="class: xl24, width: 19"]E[/TD]
[TD="class: xl24, width: 19"]R[/TD]
[TD="class: xl24, width: 19"][/TD]
[TD="class: xl24, width: 19"][/TD]
[TD="class: xl24, width: 19"][/TD]
[TD="class: xl24, width: 19"][/TD]
[TD="class: xl24, width: 19"][/TD]
</tbody>
and below is an output that I can get from a Visual Basic Macro that I copied from elsewhere in this site;
<tbody>
[TD="class: xl24, colspan: 45"]C, , , , , , , , , , CHCUCJXSYDBJLFLZVKIYGHFGKKOTKMUDUCXPFZPGER, , , , , , , CHCUCXVDLCQOETXMICMNWJAHALISUJODYTRKVCHFPQHYOZMBGWYIYKJKMGVUHTPDHATEHQTVAOTZJJIPSMNBIYWJUMLKLAVHEZQNMWFLACGEHCFNEKYKVYDXLZTXUVYIHBPHCCNUZVKHDUMSFPKDTKKHVR, , , , CHCUCJXSYDBJLFLZVKIYGHFGKKOTKMUDUCXPFZPGER,[/TD]
</tbody>
There is more but I think that will do as an example.
Here is the Macro that I used and modified slightly - (thanks to hiker95);
Sub Join_UPCS()
' hiker95, 02/23/2016, ME923576
Dim lr As Long
Application.ScreenUpdating = False
lr = Cells(Rows.Count, 1).End(xlUp).Row
Range("n28").Value = Join(Application.Transpose(Range("n23:n" & lr)), ", ")
Application.ScreenUpdating = True
End Sub
You can see that the above first copies the first letter, then adds commas, then the complete text, then more commas and the rest is from the formulae that exist in the other cells, although on my screen nothing is displayed in these cells.
I tried removing the comma and space at .....Transpose(Range("n23:n" & lr)), ", ") - Thus - ...lr)), "")
This results in a string of letters, still containing an unwanted duplicate of the first, followed by all the other unwanted letters as before.
If anyone can succeed in getting a solution, a further refinement would be to add a space after every 5th letter;
e.g CHCUC JXSYD BJLFL ZVKIY GHFGK KOTKM UDUCX PFZPG ER
Many thanks to any of you who will attempt this.
