Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,616
- Office Version
- 365
- 2016
- Platform
- Windows
I am hoping someone is able to help me complete this puzzle ... I know what I need to do, just not how to do it efficiently.
I have several rows in my database. Columns "R" and beyond may hold hold text values. What I need to do is combine all the values from column "R" to and including the last column in that row holding data.
For example =
if .cells( row, 18) is empty, nothing to concatenate
if .cells( row, 18) is the last column in that row with data than .cells( row, 18) remains unchanged
if .cells( row, 19) is the last column, .cells( row, 18) = .cells( row, 18) & "; " & .cells( row, 19).
if .cells( row, 22) is the last column with data, .cells( row, 18) = all the values joined from .cells( row, 18) to and including .cells( row, 22), each separated by "; "
I'm unsure how to do this efficiently.
This is where I have made it so far ...
I have several rows in my database. Columns "R" and beyond may hold hold text values. What I need to do is combine all the values from column "R" to and including the last column in that row holding data.
For example =
if .cells( row, 18) is empty, nothing to concatenate
if .cells( row, 18) is the last column in that row with data than .cells( row, 18) remains unchanged
if .cells( row, 19) is the last column, .cells( row, 18) = .cells( row, 18) & "; " & .cells( row, 19).
if .cells( row, 22) is the last column with data, .cells( row, 18) = all the values joined from .cells( row, 18) to and including .cells( row, 22), each separated by "; "
I'm unsure how to do this efficiently.
This is where I have made it so far ...
Rich (BB code):
With worksheet
For i = 2 To lrow
lcol = .Cells(i, .Columns.Count).End(xlToLeft).Column
If lcol > 17 Then 'there are notes
'code to combine values from column 18 on as needed
End If
Next i
End with