+ Reply to Thread
Results 1 to 8 of 8

Genrating next invoice number with a letter in front of it

  1. #1
    Registered User
    Join Date
    02-17-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Genrating next invoice number with a letter in front of it

    I am having difficulty getting the next invoice number to change with the invoice e.g i create invoice no 'G101' and would like the next invoice to be 'G102' I have no problem generating the next invoice number when only using number e.g '101' to '102' however when i add a letter in front it becomes a nuisance.

    I currently use - Sub NextInvoice()
    Range("H11").Value = Range("H11").Value + 1


    H11 being the cell that the invoice number is in.

    Can anyone help or suggest a way to get it working? I'm not too experienced on excel so i apologize in advance for the rubbish explanation.


  2. #2
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Genrating next invoice number with a letter in front of it

    I wouldnt bother with VBA, just use a formula.
    If your first invoice is in H10 (G101 for example)

    then place this in H11


    =LEFT(H10,1)&(RIGHT(H10,3)+1)

    and drag that down.

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Genrating next invoice number with a letter in front of it

    Is the invoice prefix always the same letter?

    If so, it might be easier to change the invoice # cells numberformat to
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    then just calculate / store numbers in those cells.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: Genrating next invoice number with a letter in front of it

    How about this:

    Please Login or Register  to view this content.
    This would work for any kind of text like:
    test-01-Excel36 to test-01-Excel37
    abc to abc1
    Never use Merged Cells in Excel

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Genrating next invoice number with a letter in front of it

    Double click any cell in column "H" with your basic number and the next number will appear below.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-17-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Genrating next invoice number with a letter in front of it

    Thanks Guys!

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Genrating next invoice number with a letter in front of it

    Quote Originally Posted by lewis1711 View Post
    Thanks Guys!
    Which solution did you end up using?!

    If your question has been answered, please mark this thread 'SOLVED'.

  8. #8
    Registered User
    Join Date
    02-17-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Genrating next invoice number with a letter in front of it

    I used zbor answer.

+ 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] Move 1st letter from second word to the front
    By Serge77 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-30-2013, 05:11 PM
  2. How to take from 5th letter to the front?
    By Pbox7 in forum Excel General
    Replies: 5
    Last Post: 01-21-2009, 08:14 AM
  3. Replies: 4
    Last Post: 09-22-2006, 04:05 PM
  4. Replies: 5
    Last Post: 04-28-2006, 02:00 PM
  5. [SOLVED] how to add a letter in front of each number in a cell
    By nmodafferi in forum Excel General
    Replies: 15
    Last Post: 06-16-2005, 04: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