excel 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 » Excel VBA

Excel VBA

resolvedResolved · High Priority · Version 2003

replyReply Tue 24 Jun 2008, 15:34Delegate Karen said...

Karen has attended:
Excel VBA Intro Intermediate course

Excel VBA

How can I generate the next number in a list of consecutive numbers ?

For upcoming training course dates see: Pricing & availability

replyReply Fri 27 Jun 2008, 15:53Trainer Carlos said...

RE: Excel VBA

Hi Karen

A simple way to generate consecutive numbers is by using a Variable and some form of loop. For example:

Dim Counter as Integer

For Counter = 1 To 500

<Do your thing using the Counter in the code>

Next Counter

Alternatively you could use an accumulator on the Variable

Dim MyNumber as Integer

MyNumber = 1

MyNumber = MyNumber +1

This line of code would be placed in the sequence where the next consecutive number was required

Hope this helps

Carlos













 

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

Excel tip:

Use shortcut keys to select rows or columns

Most users use the mouse to select rows or columns. It may be more convenient to use keyboard shortcuts to do that.

The shortcut key combination to select an entire row is Shift+Spacebar.

The shortcut key combination to select an entire column is Ctrl+Spacebar.

These are pretty easy to remember as the spacebar looks like a long row (or column if you're looking at it sideways). Remember that Ctrl, beginning with C, selects columns and Shift, by a process of elimination, the rows.

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