Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default combining cells' data into one cell

In my spreadsheet I have several instances of a title
followed by related cells (maybe 1 , 2 or more) of data. I
want to take the cells of data and put them into the cell
immediately to the right of this title.

e.g. Cell "A10" contains "Title".
Cell "A11" contains "text 1"
Cell "A12" contains "text 2"
Cell "A13" contains "text 3"

I want cell "B10" to contain "text 1 text 2 text 3".
Cell "A10" remains unchanged. Cells A11, A12 and A13 are
to be deleted.

How do i do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default combining cells' data into one cell

One question before this can be answered........
Since you say that there can be a varying number of entries following a
title, how do you determine which is a title and which is not?

Cheers
Nigel

"Eric" wrote in message
...
In my spreadsheet I have several instances of a title
followed by related cells (maybe 1 , 2 or more) of data. I
want to take the cells of data and put them into the cell
immediately to the right of this title.

e.g. Cell "A10" contains "Title".
Cell "A11" contains "text 1"
Cell "A12" contains "text 2"
Cell "A13" contains "text 3"

I want cell "B10" to contain "text 1 text 2 text 3".
Cell "A10" remains unchanged. Cells A11, A12 and A13 are
to be deleted.

How do i do this?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default combining cells' data into one cell

Sub ReArrangeTable()

Range("A1").CurrentRegion.Sort Key1:=Range("A1"),
Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Dim lastrow As Long
Dim cellvalue As String

lastrow = Range("A65000").End(xlUp).Row

For lastrow = lastrow To 2 Step -1

If Cells(lastrow - 1, 1) = Cells(lastrow, 1) Then

Range(Cells(lastrow, 2), _
Cells(lastrow, 200).End(xlToLeft)).Copy

Cells(lastrow - 1, 200).End(xlToLeft).Offset
(0, 1).PasteSpecial xlValue

Rows(lastrow).Delete
End If
Next
End Sub

-----Original Message-----
In my spreadsheet I have several instances of a title
followed by related cells (maybe 1 , 2 or more) of data.

I
want to take the cells of data and put them into the

cell
immediately to the right of this title.

e.g. Cell "A10" contains "Title".
Cell "A11" contains "text 1"
Cell "A12" contains "text 2"
Cell "A13" contains "text 3"

I want cell "B10" to contain "text 1 text 2 text 3".
Cell "A10" remains unchanged. Cells A11, A12 and A13 are
to be deleted.

How do i do this?
.

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
Combining data from 2 cells into 1 cell gbread Excel Discussion (Misc queries) 2 December 19th 09 08:51 AM
Combining data from multiple cells into one cell with commas lawandgrace Excel Discussion (Misc queries) 1 June 2nd 09 04:25 PM
Combining data from different cells and more... Jeff Excel Worksheet Functions 2 February 27th 09 12:11 AM
Combining data from multiple cells into one cell. Steelsilk Excel Worksheet Functions 4 May 17th 07 06:54 PM
Combining data (numeric format) in multiple cells into one cell (t GNAC SID Excel Discussion (Misc queries) 2 February 7th 05 04:09 PM


All times are GMT +1. The time now is 03:30 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"