View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Kevin Kevin is offline
external usenet poster
 
Posts: 21
Default Help on Excel VBA macro

Use the '&' to concatenate.

Sheets("sheet1").Cells(i,3) = Sheets("sheet1").Cells(i,1)
& Sheets("sheet1").Cells(i,2)

this will concatenate Ai and Bi into Ci

If you want to pad them with a space between use & " " &

kpd

-----Original Message-----
Hello,

sorry for the previous unfinished post, but I slipped on
the enter key.

I am doing an Excel macro to concatenate the contents of
several excel files. The structure of these Excel files
are the same, so I am basically automating the "copy &
paste" function. However, in the final consolidated

file,
I also need to concatenate the contents of 2 adjacent
cells (let say cells Ai and Bi where i = line number).

Do
you know how can I create a VB macro to replicate the
Excel function "contenate" ??

Thanks
.