PDA

View Full Version : Solved: Automatic concatenate



jmaocubo
05-04-2011, 04:03 AM
Hi,

Can anyone help me?

I've:

Column A defines the text to concatenate with the letter "X" appears when a blank cell stops and that's the limit. wanted him to repeat it to others. how can I do this.

Thanks for the help

Miguel (PT)

Bob Phillips
05-04-2011, 04:53 AM
Public Sub ProcessData()
Dim Lastrow As Long
Dim Startrow As Long
Dim tmp As String
Dim i As Long

Application.ScreenUpdating = False

With ActiveSheet

Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
Startrow = 2
For i = 2 To Lastrow + 1

If .Cells(i, "A").Value2 <> "" Then

tmp = tmp & .Cells(i, "B").Value2
Else

.Cells(Startrow, "D").Value = tmp
tmp = ""
Startrow = i + 1
End If
Next i
End With

Application.ScreenUpdating = True
End Sub

jmaocubo
05-04-2011, 05:26 AM
Thanks xld

It's working as i needed...