+ Reply to Thread
Results 1 to 11 of 11

Code to create numbers in sequence

  1. #1
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2003
    Posts
    5

    Code to create numbers in sequence

    To make the querry more simple I have attached the sheet
    A request to kindly access the sheet.

    Thanks
    GKT
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Code to create numbers in sequence

    Try following code (create a button in jour sheet1 and assign this macro):
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Code to create numbers in sequence

    Try the attached.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Code to create numbers in sequence

    Thanks for the reply Kaper & Jindon.
    The code is perfect but as I wanted it to be executed in the
    same sheet i.e sheet1. Is it possible?
    Else it is perfect.
    Also Jindon I wanted the result in column A only.

    Thanks again
    GKT

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Code to create numbers in sequence

    Even simpler.
    Attached Files Attached Files

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Code to create numbers in sequence

    Also mine corrected:
    Please Login or Register  to view this content.
    Slower one, but could be (who knows ) a bit easier to understand
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Code to create numbers in sequence

    Hello again Jindon
    I just re-checked the first code. It is displaying the data in column A.
    Comparing both of your code the I would prefer the first since the data
    is put up in column A . I will manage the data in sheet2.
    In that case even the Kaper solution is workable.
    Only one change if I might require in the future. The data which is
    put up in sheet2 as per the first code. I want the data from A2 onwards considering
    row 1 will be headers.

    Thanks
    GKT

  8. #8
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Code to create numbers in sequence

    row 1 with headers:
    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Code to create numbers in sequence

    Change to
    Please Login or Register  to view this content.
    You can still see col.B, if you change to
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Code to create numbers in sequence

    This is a confusing decision since both the options are acceptable to me
    and can be given SOLVED.
    But since Kaper gave the exact requirement I would grade him first and then to Jindon.
    Also I will use both the codes as and when required.

    However many thanks to both of them.

    GKT

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Code to create numbers in sequence

    Don't worry.

    Your question and the presentation of the result is confusing.
    My result at the first time is exactly the same as your presentation anyway.

+ 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. [SOLVED] Create 19rows Add numbers in sequence excel/access2007
    By accessobsess in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-10-2013, 12:26 PM
  2. [SOLVED] Macro to create new sheets with numbers in sequence
    By canyflyer in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-21-2013, 07:11 PM
  3. [SOLVED] Creating a sequence based on numbers in one column and adding "01,02..." to a new sequence
    By JCR1968 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-05-2013, 08:06 AM
  4. To generate numbers in sequence using vba code
    By Sriram Anand in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2012, 12:35 PM
  5. Replies: 6
    Last Post: 08-02-2006, 11:40 AM

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