ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA macro to join up strings (https://www.excelbanter.com/excel-programming/304870-re-vba-macro-join-up-strings.html)

Mister T

VBA macro to join up strings
 
Hi,

It seems like you don't need VBA for that. You can just type =A1&" "&B1&" "&C1 in cell D1.

If you need/want to do it in VBA,

cells(1,4).FormulaR1C1 = "=RC[-3]&"" ""&RC[-2]&"" ""&RC[-1]"

"stuart" wrote:

Hi,

This is a simple example of what I need help with.

In Excel cell A1 contains the word "The", cell B1 contains the word "Blue" and cell C1 contains the word "Ocean". I need to write a VBA macro so that cell D1 contains "The Blue Ocean". But I don't know the syntax for doing this.

Thanks.



All times are GMT +1. The time now is 07:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com