concatenating data

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Concatenating Data

Concatenating Data

resolvedResolved · High Priority · Version 2010

Freddie has attended:
Excel VBA Introduction course

Concatenating Data

Hi Team,

Firstly, many thanks for your previous responses - they have been HUGELY helpful.

I'm struggling to come up with a formula to concatenate data.

All I want to do is concatenate data in columns A and B starting from A2 and B2.

I also want to use the function Do Until Activecell.offset = ""

I've tried searching the web, but all I seem to find is really long winded VBA code - surely there is something more easier to use??

Thanks!

Freddie

RE: Concatenating Data

Hi Freddie

Here's one way of concatinating using vba.
It includes Activecell.Offset(r,c)
where r is the row and c the column position relative to the activecell.

Sub Join()

Range("A2").Select
Do Until ActiveCell = ""
ActiveCell.Offset(0, 2)=ActiveCell & " " & ActiveCell.Offset(0, 1)
ActiveCell.Offset(1, 0).Select
Loop

End Sub

Note
If you want to do the same thing without a macro type
=A2 & " " & B2
into cell C2 and double click the autofill handle.

Hope that works for your data.

Regards
Doug
Best STL

Wed 25 Feb 2015: Automatically marked as resolved.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Using Alt in Save Dialog Box

When you are saving (or opening) a file, try these;
(Note the numbers are on the keyboard not the numeric keypad)
1. Go to previous folder Alt+1
2. Go up one folder level Alt+2
3. Search the Web Alt+3
4. Delete selected file Alt+4 or Delete
5. Create a new folder Alt+5
6. Cycle through all views Alt+6 repeatedly
7. Display the Tools menu Alt+7

View all Excel hints and tips


Server loaded in 0.07 secs.