• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Concatenate the two column values into other column in Excel VBA


Hi All,

Please help to concatenate the two column values into other column. I have used below function but only one UIN (column name) is appearing in column Y of Reporting Structure. Need to bring two column value, first value from column W of Line Manager UIN and followed by column A of UIN.
In excel i have done with this formula i.e. =CONCATENATE("x:",[@[Line Manager UIN]],":" & [@UIN]) which gives the result
I am attaching the workbook(RSLM.xlsb) with the code in Module1 and also the output file (Output_RSLM.xlsb) which i need in column Y of Reporting Structure.

Any help is appreciated as this little urgent. Thanks in advance.

Function ReportingStructure(UIN As String, UINRng As Range, LMUINRng As Range) As String
Dim c As Variant
Dim LMUIN As String
Set c = UINRng.Find(What:=UIN, LookIn:=xlValues, LookAt:=xlWhole)
If c Is Nothing Then
ReportingStructure = "X:" & UIN
LMUIN = Application.Intersect(c.EntireRow, LMUINRng).Value
ReportingStructure = ReportingStructure(LMUIN, UINRng, LMUINRng) & ":" & UIN
End If
End Function


Last edited by a moderator: