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

concatenate vba

ResolvedVersion 2007

Kate has attended:
Access Introduction course
Access Intermediate course

Concatenate in VBA

I need to use VBA in order to input a formula in each cell of a column (or just the result of a formula) which uses Left/Right and Mid in order to select the components to be concatenated.

In Excel this would look like:

=CONCATENATE(LEFT(B2,2),":",MID(B2,3,2),":",RIGHT(B2,2))

in VBA I need to replace B2 with Cells(intRowCount, 6) where intRowCount increases up to the total row count.

I also want to apply two separate formulae, one if the value of B2 is greater than 2359.59 and one if it is lower.

Unfortunately I keep getting syntax errors.

Please help!

RE: Concatenate in VBA

Hi Kate

Thanks for your question

There is no VB concatenate function. Instead I suggest the following

LEFT(B2,2),&":",&MID(B2,3,2)&,":",&RIGHT(B2,2)


This should create the string you are looking for

Regards

Stephen

Sun 4 Apr 2010: 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:

Autonumber in Excel

To create an autonumber field, can use the Offset() function.

In cell A1, enter the number 1.
Then in cell A2, enter this formula:

=OFFSET(A2,-1,0)+1

Then copy the formula from cell A2, down as far as you need.

See also: Autonumber in Excel forum post.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.