1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Sequential number in Excel

Discussion in 'Business Applications' started by deerejohn1, Dec 3, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. deerejohn1

    deerejohn1 Thread Starter

    Joined:
    Dec 3, 2011
    Messages:
    3
    I am working on creating a repair oder for auto repair. What I am trying to do is have Excel generate a repair order number for each repair order created. Each repair order will have different customers, so different repair order numbers will be crucial. Also, multiple computers will use this template. I have no idea how to do this. I have attached the document with the repair order cell highlighted in yellow. Can anyone here help me figure this out.
    Excel 2010
     

    Attached Files:

  2. Pedro15

    Pedro15

    Joined:
    Oct 5, 2008
    Messages:
    386
  3. deerejohn1

    deerejohn1 Thread Starter

    Joined:
    Dec 3, 2011
    Messages:
    3
    I found a function to clear the repair order data using a click command button and VBA code. I will keep working on the sequential number function. I attached what I have thus far.
     

    Attached Files:

  4. deerejohn1

    deerejohn1 Thread Starter

    Joined:
    Dec 3, 2011
    Messages:
    3
    I have a code that I pasted into this workbook, but I am having trouble getting it to work.

    Private Sub Workbook_Open()
    Dim FName As String
    Dim FNo As String
    Dim x As Long
    FName = ThisWorkbook.Path & Application.PathSeparator & "Number.Txt"
    FNo = FreeFile
    x = 0
    On Error Resume Next
    Open FName For Input As #FNo
    Input #FNo, x
    x = x + 1
    ' *** Change range reference to suit ***
    Range("A1").Value = x
    Close #FNo
    FNo = FreeFile
    Open FName For Output As #FNo
    Write #1, x
    Close #FNo
    End Sub


    The highlighted part is what it does not like. Any ideas..

    Thanks much for the replies
     
  5. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    Why are you using Excel for this instead of Access?

    Rollin
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1029489

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice