Can anyone help out with this please?
I need to Find all columns that have a specific string in the header in Row 1 (this is a variable number of columns), then for each row from all those columns, if the cell is not empty, merge the contents into a single string for each corresponding row in another column.
The range that is to be populated with the concatenated string is ToFin here:
Any help much appreciated!
I need to Find all columns that have a specific string in the header in Row 1 (this is a variable number of columns), then for each row from all those columns, if the cell is not empty, merge the contents into a single string for each corresponding row in another column.
The range that is to be populated with the concatenated string is ToFin here:
Code:
Dim titRng As Range, foundCell22 As Range, ToFin As Range
TargetStr22 = "Other String"
Set foundCell22 = titRng.Find(what:=TargetStr22, LookIn:=xlValues, _
lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _
MatchCase:=True, SearchFormat:=False)
foundCell22.EntireColumn.Insert
Set ToFin = Intersect(foundCell22.Offset(0, -1).EntireColumn, ws1.UsedRange)
For Each FinAtCel In ToFin
[COLOR=#008000]' join values from each column where the Value in Row 1 is "Attribs Replaced" with a " / " between each joined cell[/COLOR]
Next FinAtCel
Any help much appreciated!