excel vba

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

Excel VBA

resolvedResolved · High Priority · Version 2010

Freddie has attended:
Excel VBA Introduction course

Excel VBA

Hi Guys

This is probably quite a basic IF function question here, but I seem to be struggling with this a lot!

What I have is the below:

Sheets("AUD").Select
Range("D4").Select
Do Until ActiveCell.Offset(0, -1) = ""
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-3],RC[-2],RC[-1])"
ActiveCell.Offset(1, 0).Select
Loop
If ActiveCell.Offset(0, -1) = " " Then
ActiveCell.Offset(3, 0).Select
End If
End Sub


What I'm trying to achieve is the following; to concatenate the prior 3 cells, until the activell offset (0,-1) is blank, BUT if the activecell offset(0,-1) is blank then to jump down 3 cells and continue to concatenate the prior 3 cells. I'm a little unsure to what formula to use as and when it comes to the end of concatenating the data.

Any help is greatly appreciated.

Thanks!

Freddie

RE: Excel VBA

Hi Freddie,

Thank you for your question. Would it be possible to email me an extract from your worksheet? It helps me to write the code if I can see the real data in front of me.

The email address is forum@stl-training.co.uk

Kind regards
Marius Barnard
Best STL

 

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:

Finding cells that have data restrictions

Click anywhere on the worksheet.
On the Edit menu, click Go To.
Click Special.
Click Data validation.
Click All.

View all Excel hints and tips


Server loaded in 0.08 secs.