+ Reply to Thread
Results 1 to 5 of 5

converting vertical value to horizontal within braces

Hybrid View

lovinguy converting vertical value to... 10-15-2011, 10:35 AM
arlu1201 Re: converting vertical value... 10-15-2011, 10:42 AM
MarvinP Re: converting vertical value... 10-15-2011, 10:43 AM
jaslake Re: converting vertical value... 10-15-2011, 04:05 PM
watersev Re: converting vertical value... 10-15-2011, 06:45 PM
  1. #1
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,279

    Re: converting vertical value to horizontal within braces

    Hi Lovinguy,

    You could do this manuallly with the concatinate function
    =A2&","&A3&","&A4&","&A5&","&A6&","&A7
    or use VBA Join function.
    see
    http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

    If the range of your rows changes then VBA is the way to go.

    hope this helps.
    Last edited by MarvinP; 10-15-2011 at 10:46 AM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: converting vertical value to horizontal within braces

    Hi lovinguy

    Try this
    Option Explicit
    Sub PutItTogether()
        Dim LR As Long
        Dim Rng As Range
        Dim Cell As Range
        LR = Range("A" & Rows.Count).End(xlUp).Row
        Set Rng = Range("A2:A" & LR)
        For Each Cell In Rng
            If Cell.Row = 2 Then
                Range("B2").Value = Cell.Value
            Else
                Range("B2").Value = Range("B2").Value & "','" & Cell.Value
            End If
        Next Cell
        Range("B2").Value = Range("B2").Value & "'"
    '    Range("A2:A" & LR).ClearContents
    End Sub
    If you want column A cleared uncomment this line
    '    Range("A2:A" & LR).ClearContents
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1