Thread: Concatenate
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
crazybass2 crazybass2 is offline
external usenet poster
 
Posts: 167
Default Concatenate

In the code I sent, change the Offset(0,1) to Offest(0,10) for instance if
Customer ID is in column A and Notes in column K.

Mike

"Helpless1" wrote:

Tom,
Thanks so much for your help! I should have mentioned before however that I
have other information between the customer number and note. The customer
number is in column A and the notes are in column K. This other information
is the contact information which appears with every row of notes. I need to
end up with only one row for each customer with the notes in column K in one
cell. I cannot tell you how much I appreciate you looking at this for me!

-Helpless1

"Tom Ogilvy" wrote:

Assume the customer number is in column A and the text in column B

select the cells in column A that you want to process, then run this macro

Sub ProcessData()
Dim rng As Range, cell As Range, s As String
Set rng = Selection(1)
For Each cell In Selection
If cell.Value < cell.Offset(1, 0).Value Then
s = s & " " & cell.Value
rng.Offset(0, 1).Value = Application.Trim(s)
If rng.Row < cell.Row Then
Range(rng.Offset(1, 0), cell).Resize(, 2).ClearContents
End If
Set rng = cell.Offset(1, 0)
s = ""
Else
s = s & " " & cell.Value
End If

Next
Columns(2).SpecialCells(xlBlanks).EntireRow.Delete
End Sub


Test this on a copy of your data

--
Regards,
Tom Ogilvy

"Helpless1" wrote:

HELP! I am a very minimal user and have a huge annoying project that I keep
wondering if there is an easier way to accomplish. I am doing conversion work
and have about 29000 lines left of customer information. When the info from
our old system was imported the customer notes were inserted in a new cell
with every line of text. My current method is to filter by customer number
then concatenate every line of customer notes, then copy and paste special as
values. I then delete the other lines of text and move to the next customer
number. PLEASE tell me there is any easier way! Restore my sanity!