+ Reply to Thread
Results 1 to 8 of 8

duplicate invoice number

  1. #1
    Registered User
    Join Date
    07-27-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    64

    duplicate invoice number

    Hello
    First of all I am not very good with macros and most of what I have done so far has been with the help of you people so thanks for that.I have a invoice workbook that I start with one invoice and a data sheet that the invoice draws information from the data sheet to populate the invoice I have a macro button that copies invoice to the front of the workbook and increments invoice number by one , clears contents in specific cells .I have a data validation list box in the cell where the invoice number goes(l8) that will only let invoice numbers be entered from a specific named range, which I have on my data sheet. Sometimes there might be a invoice in the middle of the workbook that I would like to copy and move to the start of the workbook because of the information that might be on it, but when I do this now it copies in front of the active sheet and increments the number by one and I would end up with a duplicate invoice number. I would either like to change the macro so that it warns me if there is duplicate invoice numbers in the workbook or change it so it will copy from anywhere in the workbook and increment invoice number by one higher than the first sheet.I hope I have explained this clear enough.I would attach sheet but workbook is to large.I will attach the macro though. Any help would be appreciated. Thanks in advance
    Option Explicit
    Please Login or Register  to view this content.
    Last edited by buckshot; 08-09-2010 at 12:55 PM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: duplicate invoice number

    Hi Buckshot
    it would be easier to solve if you could attach a sample workbook to play with.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    07-27-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: duplicate invoice number

    Thanks for the reply. Sorry about the delay but my computer crashed.I hope this attachment works,I have to change invoice a little bit but this is basically the same. If you can help i would appreciate it.
    Attached Files Attached Files

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: duplicate invoice number

    Hi buckshot
    maybe ...
    Please Login or Register  to view this content.
    the copy worksheets code will always be a unquie number

  5. #5
    Registered User
    Join Date
    07-27-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: duplicate invoice number

    Thanks.That works good,but how would I get it to always increase the the invoice number by one higher than the first sheet,even if I am copying a sheet from the middle.Thanks in advance.
    Last edited by buckshot; 08-09-2010 at 07:03 AM.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: duplicate invoice number

    One way maybe be like this
    Please Login or Register  to view this content.
    where sheet "Data" cell "P1" has the first value of 51058
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-27-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: duplicate invoice number

    Thanks,but that code changes the invoice number which is(51064) to the number 1.It works good from there on but how do i get it to increase 51064 by 1.Thanks in advance

  8. #8
    Registered User
    Join Date
    07-27-2010
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: duplicate invoice number

    Sorry.I figured out what you meant.Works great.Thank you very much

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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