Results 1 to 12 of 12

Macro to concatenate text strings

Threaded View

zcheema Macro to concatenate text... 04-23-2012, 12:41 PM
arlu1201 Re: Macro to concatenate text... 04-23-2012, 02:08 PM
zcheema Re: Macro to concatenate text... 04-23-2012, 02:18 PM
shg Re: Macro to concatenate text... 04-23-2012, 02:24 PM
zcheema Re: Macro to concatenate text... 04-23-2012, 02:29 PM
zcheema Re: Macro to concatenate text... 04-23-2012, 02:30 PM
shg Re: Macro to concatenate text... 04-23-2012, 02:32 PM
zcheema Re: Macro to concatenate text... 04-23-2012, 02:41 PM
shg Re: Macro to concatenate text... 04-23-2012, 02:44 PM
zcheema Re: Macro to concatenate text... 04-23-2012, 02:54 PM
shg Re: Macro to concatenate text... 04-23-2012, 02:55 PM
zcheema Re: Macro to concatenate text... 04-23-2012, 03:12 PM
  1. #5
    Registered User
    Join Date
    04-23-2012
    Location
    Toronto, Ontario
    MS-Off Ver
    2003
    Posts
    18

    Re: Macro to concatenate text strings

    i tried to create one..i am working on it actually but its a longer approach..
    i created this function:
    Function ConcatRange(CellBlock As Range) As String
    Dim Cell As Range
    Dim sbuf As String
    For Each Cell In CellBlock
    If Len(Cell.Text) > 0 Then sbuf = sbuf & Cell.Text & " ; "
    Next
    ConcatRange = Left(sbuf, Len(sbuf) - 1)
    
    end function

    i was thinking of first creating columns of each name in the Raw sheet i.e. append columns Tom, Harry, etc..
    and first copy their respective comments under their columns..that means in Toms column - i will copy toms comment if its non blank..

    Name comment Tom Harry
    Tom 123 123
    harry xcbv xcbv
    peter
    tom 332 332


    and then i could call the concatrange function that i have created. it works fine but i see extra delimiters i.e. ";" after each comment. if i could remove these for non blank cells then i could concatenate them all..
    does this make sense? i know its a longer approach!!! i coudlnt figure out a decent macro so tried the function instead..
    Last edited by arlu1201; 04-23-2012 at 02:42 PM. Reason: Use code tags in future.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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