iswinky
iswinky

Reputation: 1969

Concatenate two columns in Excel VB Macro to column in second spreadsheet

I need to concatenate two columns in People.xls Range("A2: A100") and ("B2:B100") to Places.xls Range ("A2: A100") using a VB Macro. I've tried recording a macro and copying and pasting the values from an additional column in C3: C100 which contained the concatenate formula `=CONCATENATE(A2, " ", B2). But this doesn't see to work very well, and isn't very practical. Is there any way it can be done using VB in the macro itself? I've been playing around but I'm having no luck

Upvotes: 0

Views: 1816

Answers (1)

Peter Albert
Peter Albert

Reputation: 17515

Try this:

With Range("C1:C100")
    .Formula = "=Sheet2!A1&"" ""&Sheet3!B1"
    .Value = .Value
End With

Upvotes: 2

Related Questions