View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default VBA macro to join up strings

Stuart,

You can do this with a formula rather than VBA. E.g., in cell D1,
=A1&" "&B1&" "&C1

If you do want VBA, use

Range("D1").Value = Range("A1").Value & " " & Range("B1").Value &
" " & Range("C1")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"stuart" wrote in message
...
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.