Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
Macro 'Automation error' with ChemOffice Excel macro | Excel Programming |