Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Merging cells text

Hi,

I have one question,


Input:

A1 contains: Selvam K
C1 contains: Frank
D10 contains: gdselva
d1:d5 contains: 10, 20, 30, 40, 50


Output:
A1 contains:
Selvam K, Frank, gdselva, 10, 20, 30, 40, 50


The selection should be using Ctrl + a1, c1, d10, d1:d5 this sequence
The output should be merged all the cell values and display into th
first selected cell.


Can you help me I to do it.


Regards,

Selvam

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Merging cells text

You will need the data in A1 to be held elsewhere say b1.
Then A1 will have the following formula:

=B1&", "&C1&", "&D10&", "&D1&", "&D2", "&D3", "&D4", "&D5

You will need to make sure there is a space after the
comma otherwise it will all run together as one long group
of letters and numbers.

BOL
David C
-----Original Message-----
Hi,

I have one question,


Input:

A1 contains: Selvam K
C1 contains: Frank
D10 contains: gdselva
d1:d5 contains: 10, 20, 30, 40, 50


Output:
A1 contains:
Selvam K, Frank, gdselva, 10, 20, 30, 40, 50


The selection should be using Ctrl + a1, c1, d10, d1:d5

this sequence.
The output should be merged all the cell values and

display into the
first selected cell.


Can you help me I to do it.


Regards,

Selvam K


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Merging cells text

Try this:

Sub MergeVals()
Dim c As Range, rng As Range
Dim txt As String
Set rng = Selection
txt = rng(1)
For Each c In rng
If Intersect(c, rng(1)) Is Nothing Then _
txt = txt & ", " & c
c = ""
Next
rng(1) = txt
End Sub

Regards,
Greg

-----Original Message-----
Hi,

I have one question,


Input:

A1 contains: Selvam K
C1 contains: Frank
D10 contains: gdselva
d1:d5 contains: 10, 20, 30, 40, 50


Output:
A1 contains:
Selvam K, Frank, gdselva, 10, 20, 30, 40, 50


The selection should be using Ctrl + a1, c1, d10, d1:d5

this sequence.
The output should be merged all the cell values and

display into the
first selected cell.


Can you help me I to do it.


Regards,

Selvam K


---
Message posted from http://www.ExcelForum.com/

.

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
merging text from two cells mariekek5 Excel Discussion (Misc queries) 3 July 9th 09 03:00 PM
merging cells text between 2 or spreadsheets genesius Excel Discussion (Misc queries) 0 December 3rd 08 09:51 PM
Merging multiple cells with text Gaetan Excel Discussion (Misc queries) 9 August 28th 07 04:20 PM
Text from 2 Cells merging to another...Help jgbadingerjr Excel Discussion (Misc queries) 2 March 29th 07 02:56 AM
Merging cells and text wrap Taecan New Users to Excel 2 September 30th 05 06:55 PM


All times are GMT +1. The time now is 12:47 AM.

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"