#1   Report Post  
Posted to microsoft.public.excel.programming
Reg Reg is offline
external usenet poster
 
Posts: 48
Default merge text

I have a spreadsheet that was created by another person.
They have broken sentences into individual cells
Sort
of
like
this

this continues for several hundred lines and I have to maintain it!

I've played with =concatenate and a couple of other things but what I really
nees is to figure out a macro that takes the current selection (say b1:b6)
and concatenates it into b1 (ie: b1 = b1&b2&b3&b4&b5&b6) - I know how to add
spaces etc but thats is a secondary concern.

The number of cells to add together is always different but they are always
in columns.

I have played with snippets of code and such and could probably make this
work if I had a couple of weeks to understand the model (I'm new to this -
did you guess?) but this must be something someone has come across before?


Can anyone point me at some code or ideas that will give me a jump start?

TIA

Greg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default merge text

function GetText(rng as range) as string

dim c as range, v as string

for each c in rng
if c.value<"" then v=v & iif(v="",""," ") & c.value
next c

GetText=v
end function

--
Tim Williams
Palo Alto, CA


"Reg" wrote in message ...
I have a spreadsheet that was created by another person.
They have broken sentences into individual cells
Sort
of
like
this

this continues for several hundred lines and I have to maintain it!

I've played with =concatenate and a couple of other things but what I really
nees is to figure out a macro that takes the current selection (say b1:b6)
and concatenates it into b1 (ie: b1 = b1&b2&b3&b4&b5&b6) - I know how to add
spaces etc but thats is a secondary concern.

The number of cells to add together is always different but they are always
in columns.

I have played with snippets of code and such and could probably make this
work if I had a couple of weeks to understand the model (I'm new to this -
did you guess?) but this must be something someone has come across before?


Can anyone point me at some code or ideas that will give me a jump start?

TIA

Greg



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
Need to add text to all cells in excel or merge the text in two ce Juan Maldonado Excel Discussion (Misc queries) 1 September 8th 09 03:11 AM
text outside merge cells despite clicking wrap text chedd via OfficeKB.com Excel Worksheet Functions 5 July 17th 08 09:01 PM
I cannot see all of my text when I merge cells. cmatto Excel Discussion (Misc queries) 1 June 29th 07 06:05 PM
Help for VBA Text Merge Ron Excel Discussion (Misc queries) 2 May 17th 06 05:29 PM
How do I merge new text into existing text cells. bweiner Excel Discussion (Misc queries) 2 December 12th 05 12:36 AM


All times are GMT +1. The time now is 09:11 PM.

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

About Us

"It's about Microsoft Excel"