excel vba

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

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

Excel VBA

resolvedResolved · High Priority · Version 2003

Karen has attended:
Excel VBA Intro Intermediate course

Excel VBA

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

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













 

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:

Moving or Copying Sheets Between Workbooks in Excel 2010

Here's how to move or copy sheets between workbooks in Excel 2010:

Open the sheet you want to move or copy then on the Ribbon click the Home tab. Click Format. Under Organize Sheets, select the option Move or Copy Sheet and then choose where you want the sheet to be moved/copied to.

View all Excel hints and tips


Server loaded in 0.07 secs.