+ Reply to Thread
Results 1 to 7 of 7

How to auto generate sequence number

  1. #1
    Registered User
    Join Date
    11-06-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    6

    How to auto generate sequence number

    I have this invoice management excel sheet that automatically transfer data in another sheet after clearing using a button, I just need to automatically generate the invoice number in the main invoice sheet,so when it copied to the record sheet it is in sequence, also I wanted the format to be as 001, 002 and so on.

    Please help.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,690

    Re: How to auto generate sequence number

    Please share the code which you are having to clear the data so that we can preserve the value and clear the data and increment it and reassign it in that cell.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    11-06-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to auto generate sequence number

    Hi, thanks for the quick response.
    This my code, this is already working for transferring and clearing data, only I'm working with the invoice number.


    Sub ERRT()
    Sheets("sheet4").Select
    If Range("A:A").End(xlDown).Row = 1048576 Then
    j = 1
    Else
    j = Range("A:A").End(xlDown).Row
    End If
    Sheets("sheet4").Select
    Dim a(7)
    a(0) = Range("sheet1!F3")
    a(1) = Range("sheet1!F4")
    a(2) = Range("sheet1!B4")
    a(3) = Range("sheet1!B7")
    a(4) = Range("Sheet1!C7")
    a(5) = Range("Sheet1!F13")
    a(6) = Range("Sheet1!F14")
    a(7) = Range("Sheet1!F15")

    For i = 0 To 7
    Cells(j + 1, i + 1) = a(i)
    Next
    Sheets("sheet1").Select
    Range("A7:A12,D7:D12").Select
    Selection.ClearContents
    Range("F3") = a(0) + "1"
    End Sub

  4. #4
    Registered User
    Join Date
    11-06-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to auto generate sequence number

    Please see also my excel file.
    Thanks.
    Attached Files Attached Files

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,690

    Re: How to auto generate sequence number

    Please add code tags for Post # 3 to enable us to give reply

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

  6. #6
    Registered User
    Join Date
    11-06-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to auto generate sequence number

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-06-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to auto generate sequence number

    Hope you find it in order now, thank you.

+ 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. Auto generating sequence number
    By DKAbi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-29-2013, 09:38 PM
  2. Replies: 3
    Last Post: 06-18-2011, 01:17 PM
  3. [SOLVED] generate sequence of number
    By cyzax7 via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2006, 04:00 AM
  4. How do I set up Auto sequence number in excle
    By Nassir in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 06-08-2006, 03:15 PM
  5. Replies: 6
    Last Post: 08-04-2005, 10:05 PM

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