ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cocatenation (https://www.excelbanter.com/excel-programming/365611-cocatenation.html)

delmac

cocatenation
 
i I need to concatenate several cells to make up one cell as a description
for a item number. e.g.
cell a1 may contain the item number and cells b1 and b2 the part description
that have to be concatenated to cell c1 to make the full description. The
only thing is some items have as many as 8 cells of part descriptions for eg
cell a10 may have have cells b10,b11,b12,b13,b14,b15 as containing parts of
the description that all have to be concatenated. I have a problem, As I have
over 2000 items to do ,can anyone help with functions /macros to help me with
this .
Thanks again everyone.
--
delmac

Ingolf

cocatenation
 
Hi, delmac

I assumed the cells in column A between the item numbers are empty and
there is no empty row between two items, right? So, this should work.

Sub ConcParts()

Dim rng As Range
Dim i As Integer

For Each rng In Range("C1:C" & Cells(Rows.Count, 2).End(xlUp).Row)
If rng.Offset(0, -2) < "" Then
Do
rng = rng & rng.Offset(i, -1)
i = i + 1
Loop Until rng.Offset(i, -2) < "" Or rng.Offset(i, -2).Row _
Cells(Rows.Count, 2).End(xlUp).Row

End If
i = 0
Next 'rng

End Sub

Regards
Ingolf

i I need to concatenate several cells to make up one cell as a description
for a item number. e.g.
cell a1 may contain the item number and cells b1 and b2 the part description
that have to be concatenated to cell c1 to make the full description. The
only thing is some items have as many as 8 cells of part descriptions for eg
cell a10 may have have cells b10,b11,b12,b13,b14,b15 as containing parts of
the description that all have to be concatenated. I have a problem, As I have
over 2000 items to do ,can anyone help with functions /macros to help me with
this .
Thanks again everyone.
--
delmac




All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com