1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. 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

    Hui...

  3. 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

Discussion in 'VBA Macros' started by AmitSingh, Oct 9, 2018.

  1. AmitSingh

    AmitSingh New Member

    Messages:
    22
    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
    x:802422055:600124663.
    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.



    Code (vb):
    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
    Else
    LMUIN = Application.Intersect(c.EntireRow, LMUINRng).Value
    ReportingStructure = ReportingStructure(LMUIN, UINRng, LMUINRng) & ":" & UIN
    End If
    End Function

    Attached Files:

    Last edited by a moderator: Oct 9, 2018
  2. vletm

    vletm Excel Ninja

    Messages:
    4,415
    AmitSingh
    Are ALL Y-column results values ALWAYS same as in Your two files?
  3. vletm

    vletm Excel Ninja

    Messages:
    4,415
    AmitSingh
    ... so little urgent ...
    Press Cell Y1's [ Do It ]-button.

    Attached Files:

    AmitSingh likes this.
  4. AmitSingh

    AmitSingh New Member

    Messages:
    22
    Thank you vletm for helping me in quick time.

Share This Page