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

offset if statement

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Offset / if statement

Offset / if statement

ResolvedVersion 2003

Richard has attended:
Excel VBA Intro Intermediate course

Offset / if statement

Hi, do you have an example of an offset function used in conjunction with an if statement, e.g if cell A1 contains 'Customer ABC Ltd' , then copy the cell containing 'Customer ABC Ltd' to one cell to the left of the copied cell and copy it down 6 rows, or six cells?

Hope im clear, thank you.

RE: Offset / if statement

Hi Richard

Attached you will find a Workbook with a list of names starting in cell "A1", that also contains a macro "CopyData".

Running this macro, which starts looking in cell "A1", it will copy the relevant cell 6 columns to the right if the cell contains the words "ABC Ltd"

The macro runs until it finds a blank cell in column A

Hope this helps

Carlos

Attached files...

Copy Using Offset.xls

RE: Offset / if statement

Cheers Carlos - much appreciated!

Richard.

 

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:

Excel 2010 Shortcuts - Start and End of the Worksheet

Did you know you can quickly move to either the beginning or the end of an Excel Worksheet using just a couple of keys on the keyboard?

Press Ctrl + Home key to move the cursor to cell A1

Press Ctrl + End key to move the cursor to the end of the current worksheet.

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.11 secs.