Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help on Excel VBA macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Help on Excel VBA macro

Result = Range("A2").Value & Range("B2").Value
or
Result = Cells(i,1).Value & Cells(i,2).Value where i is the row#

Bob Umlas
Excel MVP

"Thierry" wrote in 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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
.

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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Macro 'Automation error' with ChemOffice Excel macro Stew Excel Programming 0 October 27th 03 08:26 PM


All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"