Forum Discussion

style3body's avatar
style3body
Copper Contributor
Jul 13, 2021
Solved

User Input Outcome

Dear All I hope you are having a great day    first, I would like to thank you all for your effort    I need your support regarding this issue:    Device and OS platform, Windows 10  Excel p...
  • HansVogelaar's avatar
    Jul 13, 2021

    style3body 

    Create the following function in a module in the Visual Basic Editor:

    Function Res(rng As Range) As String
        Dim i As Long
        Dim s As String
        For i = 1 To Application.CountA(rng) - 1
            s = s & "," & rng(i).Value
        Next i
        If s <> "" Then
            Res = Mid(s, 2)
        End If
    End Function

    Let's say the first input range is A2:D2. In E2, enter the formula

    =Res(A2:D2)

    This can be filled/copied down.