Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default creating a txt string from multiple cells separated by | symbol

Trying to create a very long txt string from hundreds of separate cells so I
can import into another program.
This needs to be smart as I need to do this operation often

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default creating a txt string from multiple cells separated by | symbol

Define "smart". What are your rules for determining what is included in the
long text string and what isn't?

"Pukeko47" wrote:

Trying to create a very long txt string from hundreds of separate cells so I
can import into another program.
This needs to be smart as I need to do this operation often

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default creating a txt string from multiple cells separated by | symbol

Sub ConCat_Cells()
Dim X As Range
Dim y As Range
Dim Z As Range
Dim w As String
Dim sbuf As String
On Error GoTo endit
w = InputBox("Enter the Type of De-limiter Desired")
Set Z = Application.InputBox("Select Destination Cell", _
"Destination Cell", , , , , , 8)
Application.SendKeys "+{F8}"
Set X = Application.InputBox _
("Select Cells, Contiguous or Non-Contiguous", _
"Cells Selection", , , , , , 8)
For Each y In X
If Len(y.text) 0 Then sbuf = sbuf & y.text & w
Next
Z = Left(sbuf, Len(sbuf) - Len(w))
Exit Sub
endit:
MsgBox "Nothing Selected. Please try again."
End Sub



Gord Dibben MS Excel MVP



On Sun, 6 Sep 2009 18:39:01 -0700, Pukeko47
wrote:

Trying to create a very long txt string from hundreds of separate cells so I
can import into another program.
This needs to be smart as I need to do this operation often


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
text string separated by comma Atishoo Excel Discussion (Misc queries) 6 February 12th 09 05:19 PM
Extracting text separated by | from string? JJFad Excel Discussion (Misc queries) 3 January 15th 09 12:43 PM
Excel 2003 - A string of #s needs to be separated into individual Sammy Excel Discussion (Misc queries) 3 March 21st 08 04:05 PM
Creating a text string by reading content in multiple cells smaruzzi Excel Worksheet Functions 3 February 8th 07 05:12 PM
parse comma separated text to multiple cells and remove duplicates doon Excel Worksheet Functions 11 October 26th 06 03:46 PM


All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"