Thread: CONCATENATE
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] sbitaxi@gmail.com is offline
external usenet poster
 
Posts: 158
Default CONCATENATE

On Sep 10, 3:03*pm, wrote:
Hi,
I have a file that from Column A to AD and Rows 5 to 98 has formulas
that is linked to a data in different worksheet, some cells are only
numbers and some have text and numbers and some are blank, I am trying
to "CONCATENATE" each row to a cell with a "/" in between but it
should leave out the blank cells.
I would appreciate for any help.
Thanks,


Insert a column before A, and use the following.
Untested, please try on a sample.

Sub ConcatCells ()
Dim MyCell as Range
Dim MyRng as Range

Set MyRng = Range("A:A")
For Each MyCell In Range(MyRng)
With Application
MyCell.Formula = RTrim(Join(.Transpose(.Transpose _
(MyCell.Resize(, 30))), "/"))
MyCell.Replace What:="//", Replacement:="/", _
Lookat:=xlPart
End With
Next
End Sub