Concatenate using VBA
Amazing chart utilities from Jon Peltier
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Concatenate using VBA

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I want to concatenate several cell separated by the "|" symbol, I know that in excel this would be: a4=a1&"|"&a2&"|"&a3

    How can I do this in VBA??????

    Hugo

  2. #2
    MrExcel MVP Russell Hauf's Avatar
    Join Date
    Feb 2002
    Location
    Portland, OR Area - USA
    Posts
    1,605
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    On 2002-02-22 17:05, huorsa wrote:
    I want to concatenate several cell separated by the "|" symbol, I know that in excel this would be: a4=a1&"|"&a2&"|"&a3

    How can I do this in VBA??????

    Hugo
    try this:

    Code:
    Sub MySub()
        Dim MyString as String
    
        MyString = Range("A4") & "|" & Range("A5")
    
        ' ...etc.
        ' Then if you want to put in a cell:
    
        Range("A1") = MyString
        ' or, combine the 2:
        Range("A1") = Range("A4") & "|" & Range("A5")
    
    End Sub
    Hope this helps,

    Russell

    [ This Message was edited by: Russell Hauf on 2002-02-22 17:16 ]

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com