Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
merging text from two cells | Excel Discussion (Misc queries) | |||
merging cells text between 2 or spreadsheets | Excel Discussion (Misc queries) | |||
Merging multiple cells with text | Excel Discussion (Misc queries) | |||
Text from 2 Cells merging to another...Help | Excel Discussion (Misc queries) | |||
Merging cells and text wrap | New Users to Excel |