vba
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 » VBA

VBA

resolvedResolved · Low Priority · Version 2003

replyReply Fri 13 Mar 2009, 16:02Delegate Alexis said...

Alexis has attended:
Excel VBA Intro Intermediate course

VBA

when do you use code beginning with cell, and when do you use range?

For upcoming training course dates see: Pricing & availability

replyReply Mon 16 Mar 2009, 14:53Trainer Carlos said...

RE: VBA

Hi Alexis

There is no specific rule as to whether you refer to a cell by Range or Cells. For example:

Range("B3")

In Excel, the Range object has a method called Cells.

Note that Cells is a method - not an object. When the Cells method is evaluated, it returns an object (specifically, a Range object).

The Cells method takes two arguments: the row and the column. So the above range can also be written as:

Cells(3, 2)

The advantage of using the Cells method becomes apparent when you replace the arguments with variables.

Then you can use a loop to increment the variables and access a range of cells.

Hope this helps

Carlos

Mon 23 Mar 2009: Automatically marked as resolved.

 

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

Excel tip:

Charts

Select the data and press the function key F11 and the chart will be created on a separate worksheet.

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