+ Reply to Thread
Results 1 to 3 of 3

Macro to Add Consecutive Numbers

  1. #1
    Registered User
    Join Date
    11-18-2015
    Location
    Kansas City, MO
    MS-Off Ver
    Excel 2010
    Posts
    1

    Macro to Add Consecutive Numbers

    I am using Excel 2010 and need a macro that will enter consecutive numbers in a column for one type of spreadsheet used at my company.

    I have Microsoft query populate my spreadsheet and once the query refreshes, I run a macro to duplicate the applicable number of lines that I need. The one piece that is missing is I need to have one of the columns populated with consecutive numbers, 1, 2, 3, 4, and so on until the end of the duplicated data.

    I know that I can use the Fill function, but these particular spreadsheets are for users with very basic Excel skills--the more I can automate them, the better for everyone! I am fairly new at VBA and writing macros, but am trying to learn as quickly as possible.

    Thanks in advance for all your help!

    Mary

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,691

    Re: Macro to Add Consecutive Numbers

    Here is some code I use to fill a list of numbers

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to Add Consecutive Numbers

    There is a feature called Record Macro that will create a macro for you. Start recording yourself using the Fill Series function and then you should be able to run it over to duplicate what you performed on the worksheet.
    If you are happy with my response please click the * in the lower left of my post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Consecutive numbers
    By newx in forum Excel General
    Replies: 8
    Last Post: 09-08-2015, 09:04 PM
  2. Finding 5 consecutive numbers in a set of 7 numbers
    By Namejs in forum Excel General
    Replies: 13
    Last Post: 05-20-2015, 06:35 AM
  3. Macro auto-fill: Blocks of consecutive decimal numbers with blank row in between them
    By markbs123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2014, 07:04 AM
  4. How to print page numbers in consecutive order in a Macro.
    By MJFP&A in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2013, 12:42 PM
  5. Replies: 6
    Last Post: 03-23-2012, 06:03 PM
  6. Excel macro to "fill in" consecutive numbers in non-consecutive list?
    By Tomkat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-03-2009, 01:13 PM
  7. consecutive numbers
    By amyenoch in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-01-2005, 01:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1