offset if statement
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

Offset / if statement

resolvedResolved · Medium Priority · Version 2003

replyReply Tue 9 Sep 2008, 16:39Delegate Richard said...

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.

For upcoming training course dates see: Pricing & availability

replyReply Fri 12 Sep 2008, 11:36Trainer Carlos said...

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

replyReply Fri 12 Sep 2008, 11:55Delegate Richard said...

RE: Offset / if statement

Cheers Carlos - much appreciated!

Richard.

 

Please browse our web site to find out more about
excel-training-advanced courses and other Microsoft training courses.

Excel tip:

Keyboard Shortcuts to Add Rows or Columns

Couple of other keyboard shortcuts. Shift+spacebar selects a row, Ctrl+spacebar selects a column. Select either row or column (or several) and use Ctrl and + to insert or Ctrl and - to delete rows or columns.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard