Excel VBA - Clear Invoice and Automate Next Invoice Number

Поділитися
Вставка
  • Опубліковано 5 лип 2024
  • Download the featured invoice template here
    www.bluepecantraining.com/exc...
    Full playlist for this video series: • Create an Automated In...
    Check out Simple Sheets Invoice Template (all purchases help support this channel)
    www.simplesheets.co/a/2147525...
    This tutorial is part of a series of tutorials that demonstrate how to create an automated invoice system in Microsoft Excel. This video looks writing a VBA macro that clears the current invoice and automatically generates the next invoice number.
    Other videos in this series show you how to write VBA macros that
    1) Create the invoice itself
    2) Add the invoice details to a record of invoices
    3) Save the invoice as an Excel workbook or as a PDF
    4) Automatically email a PDF version of the invoice to the customer
    Table of Contents:
    00:00 - Introduction
    02:15 - VBA code to create next invoice number and clear current invoice
    06:27 - Use IFNA to hide VLOOKUP #N/A errors
    07:32 - Create a button to run the VBA macro
    ------------------------
  • Навчання та стиль

КОМЕНТАРІ • 76

  • @gabz1989a
    @gabz1989a Рік тому +6

    your videos are not getting enough recognition! I know nothing about VBA and I am learning so much

  • @sarahbaskerville4615
    @sarahbaskerville4615 2 роки тому +1

    Becoming more familiar. I'm playingyour videos over and over, stopping and starting... So useful. I'm doing this instead of paying for an invoice app. Using a lot of grey matter but even I csn understand. Thank you so much!

    • @ChesterTugwell
      @ChesterTugwell  2 роки тому

      Sarah, hope you get your head around it and save yourself pennies on an invoice app. Thanks for your comment.

  • @francesfletcher9180
    @francesfletcher9180 Рік тому

    Thanks again, Chester! Great tutorial!

  • @balabalan1846
    @balabalan1846 Рік тому +2

    Best explanation by far for us totally new to the software, thanks for your ti man, really looking forward to learning how to make so

    • @Info-God
      @Info-God Рік тому

      You will be in dis-belief what VBA-Excel can do. I'm advsbced/expert and I am just thrilled of what I did. No other software can do such amazing things (of course C, C++ are at the core of everything but it takes huge time, many people and organization to create a tool like MS Excel).

  • @user-xf8mj7db4u
    @user-xf8mj7db4u Рік тому

    Thank You Very Much! Learned and Applied... God Bless!

  • @cd5380
    @cd5380 29 днів тому

    excellent work and very helpful. you are an amazing source of information and help. thanks so much!!!

  • @wayneedmondson1065
    @wayneedmondson1065 2 роки тому +1

    Great! Thanks Chester. Thumbs up!!

  • @kernalgaming_xL
    @kernalgaming_xL 6 місяців тому

    Thanks for your tutorial it has been amazing as I am just starting out in my business, it has helped me alot I can not imagine now not using this excel spreedsheet

  • @abidj.guerrero1992
    @abidj.guerrero1992 3 місяці тому

    A perfect work, you rock! Thanks man.

  • @createistudyo1055
    @createistudyo1055 2 роки тому

    Thank you for this ❤️

  • @rahuljangidfitness
    @rahuljangidfitness Рік тому

    this video is so useful to make an automatice invoice.

  • @motazyamin
    @motazyamin 29 днів тому

    it is great series >>>Thanks

  • @mattkriese7170
    @mattkriese7170 Рік тому +1

    Hi there! I'm a newbie and I'm trying to use python and it's libraries as my go-to. I was wondering if you had any documentation for this or any of your other videos in this playlist? I really appreciated the vid so thank you!

  • @arcaarya1787
    @arcaarya1787 Рік тому

    Thank you so much sir
    🔥🔥🔥

  • @maxkollek8138
    @maxkollek8138 Рік тому

    Great! Thanks a lot mate‘

  • @ikspeel
    @ikspeel 9 місяців тому

    beautiful video
    hopefully you can help
    If I have a large order with more than a hundred different items, how should I add the line with s/n product description, QTY, unit price at the top of page 2 of the invoice? Is there a way for this to happen automatically?

  • @DraganTanevski-bq2uf
    @DraganTanevski-bq2uf 2 місяці тому

    It works perfect. Thank you. Question - how to make next invoice number to have leading zero in front of the invoice number?

  • @ImranKhan-qw7ge
    @ImranKhan-qw7ge Рік тому

    Thanks Chester, I would like to add the Service Usage & Discount History Graphical View to the Invoice with Recurring Invoicing System can you please share a video linking the same to the Invoice

  • @janaknagwani3690
    @janaknagwani3690 2 роки тому

    Really helpful
    please add feature in which we can maintain and delete the records as well customer wise

  • @ChesterTugwell
    @ChesterTugwell  Рік тому +2

    *****If you are having trouble with your logo being deleted use this code:*****
    For Each shp In ActiveSheet.Shapes
    If shp.Type msoPicture Then shp.Delete
    Next shp

  • @affandimajid
    @affandimajid Рік тому

    i found your valuable video and i learned a lot from it. Thank you so much

  • @This_Planet
    @This_Planet 9 місяців тому

    fabulous

  • @coolag74
    @coolag74 Рік тому

    Excellent...
    I successfully made an auto receipt number for my form through your tutorial. If I have any problem in VBA can you help me?
    Thanks

  • @user-ny6pi8eg8d
    @user-ny6pi8eg8d Рік тому

    Dear sir.... thank you so much for your beautiful and sophisticated method of building the invoice but I have a requirement. After pressing the "Start New Inv" button, that button will be hidden or not operate until the next session. what is the procedure?.please make a video sir on that topic.

  • @leonzhou3346
    @leonzhou3346 5 місяців тому

    A great video! Thank you!
    What if there is no email. how to clear return value and make the cell blank?

  • @jamesselmon8104
    @jamesselmon8104 Рік тому

    This is exactly what I have been looking for. Can I purchase this template from you?

  • @chunking5447
    @chunking5447 Рік тому +2

    Thanks for the great content. I’m wondering how to avoid the problem of starting the new invoice without ripping out of the formulae? I mean the sum function in the description box. Thanks!

    • @bp_hr
      @bp_hr Рік тому +1

      Thats happening to me also. I tried different clearxxx but it deletes everything or nothing

    • @7073cain
      @7073cain 6 місяців тому

      Try not including the column with the formula (such as the VLOOKUP one, e.g) in the ClearContents command, just clear Column B or whatever column the formula refers to.

  • @MarkBlakeman-mt8mb
    @MarkBlakeman-mt8mb Рік тому

    your videos are excellent- on the create new invoice button when it opens and new invoice the customer name disappears but the remainder of their details turns to a date and i cant work out why despite trying the IFNA function can you help

  • @amanuelyohannes7151
    @amanuelyohannes7151 8 місяців тому

    Thank you for the videos. It's priceless! Quick question I am getting an error "We can't do that to a merged call." There could be a work around but I am concerned how it will affect the previous settings.
    Thank you.

    • @7073cain
      @7073cain 6 місяців тому

      Make sure all the columns are included in the Macro line where you did the ClearContents. For example, My merged cell spanned columns A to D, instead of A to C so error was fixed when I made that change.

  • @officialmikedl
    @officialmikedl Рік тому +2

    Hi Chester! This video has helped me a lot! Only one issue, my invoice number does change when I click the macro button, but the message box always says "your next invoice is 1" haha. Please help me with this issue! Love your videos by the way!

    • @polyvspavel
      @polyvspavel 7 місяців тому

      same have you sorted it?

  • @tomchmiel9947
    @tomchmiel9947 Рік тому

    is there a way to generate an invoice with sequential numbers for all the customers at the same time? like monthly group invoices - I'm trying to avoid doing one customer at a time :D

  • @mituldesai7918
    @mituldesai7918 2 місяці тому

    Thank you for this amazing explanation. When I run this it says "Compile error: Invalid use of property" and highlights the first line which is "sub CreateNewInvoice()". How can I fix this? Thank you in advance

  • @fareedquraishi
    @fareedquraishi 3 місяці тому

    Great Chester, I am following your video and practicing but I am facing problem at "StartNewInvoice()" VBA Code, against a cell associated with Customer Name. where it says "we can't do that to merged cell" Runtime error 1004.
    Request your advice

  • @Tate.Central
    @Tate.Central 2 роки тому

    Fantastic! amazing
    can you make a video on creating a unique customer ID that is alphanumerical. which can be used as a invoice number which increment by 1 in sequence every times we process the invoices for the particular customer

  • @muhammedaslam5937
    @muhammedaslam5937 Рік тому

    Could please help me on the range to clear when opening a new invoice, for mine it’s showing as we can’t do clear content for merged cell 😢

  • @zeeshanrashid495
    @zeeshanrashid495 2 роки тому +4

    Dear Mr Chester Tugwell thank you so much for such a informative video . I replicated your sheet and I am having problem when i do clear invoice contents. When i do ".clearcontents", the formulae in the invoice sheet disappear. The sum formulae i mean. For every new invoice , i have to put sum formulae manually. Please help me in automate my sheet. I would be very thankful to you.

    • @jhonnybajaj90
      @jhonnybajaj90 8 місяців тому

      Hi, need help. Did you find a solution to your issue? I have been facing the same issue

  • @Red-bw1vm
    @Red-bw1vm 3 місяці тому

    i need help doing this with merged cells without losing my formulas or data validations

  • @coolraghumiskin09
    @coolraghumiskin09 Рік тому

    It is possible to create an alphanumeric digit/Number.please

  • @rosieval6994
    @rosieval6994 5 місяців тому

    I love your videos, and I'm learning a lot, but when I make the next invoice number module code, and try to run it, it gives me an error, telling me that can't be done because cells are merged
    What do I do? Please help

  • @anthonymounts3567
    @anthonymounts3567 Рік тому

    I'm having a problem with its saying it can't do it to a merged cell. Is there a way to fix this?

  • @jigarparikh4417
    @jigarparikh4417 4 місяці тому

    dear @ChesterTugwell sir, my invoice number is showing only 1 after running vba, rest everything is fine. Please help

  • @krmotion1522
    @krmotion1522 Рік тому

    Sir please help me...
    I was try taxable invoice for Grocery shop......
    If I was make invoice and click button "Go" , save this in invoice move in second sheet automatically after click button.........
    How to possible this macro.........I need invoice sheet invoice number wise set..........

  • @ItsAndoRn
    @ItsAndoRn 11 місяців тому

    ❤❤

  • @alekyeremeef1152
    @alekyeremeef1152 29 днів тому

    what if you accidently click button and add same record 2-3 times, is there a logic that can prevent you from adding duplicated records?

  • @allyssalopez2125
    @allyssalopez2125 4 місяці тому

    Hi Chester! I am stuck in IFNA function (6:49) of this video. Not sure why it doesn't work - an error message #NAME? pops up and cannot carry on! Please help!

  • @tanianethercote8194
    @tanianethercote8194 Рік тому

    Hi ... new to modules ... when I insert for Module 2, the visual basic for module 1 disappears...eek...what have i done? Also new to youtube...lol...wondering how I'll know if you answer...oh dear...not my night

  • @KyprianouSpyros
    @KyprianouSpyros 9 місяців тому

    guys get this message when i run it
    Run-tim error '1004':
    we can't do that to a merge cell.
    how can i fix this?

  • @ehanusman9462
    @ehanusman9462 Рік тому

    How to use multiple VLOOK multiple time in a cell, Like City,provine, postal code

  • @tonamiali
    @tonamiali 10 місяців тому

    Somehow the (Save as PDF, and Save as .xlsx) doesn't work in my macbook.

  • @rahuljangidfitness
    @rahuljangidfitness Рік тому

    If i want to add some alphabate in my invoice no. like, GHH/2023-24/005 and next invoice like , GHH/2023-24/006 and next is , GHH/2023-24/007 . Mean i want to increage only last digite of my Number . So what code I have to right ? Reply in comment.

  • @lovelymusic5672
    @lovelymusic5672 Рік тому

    How to add a alphabet before the invoice number?

  • @waleedalbuamer844
    @waleedalbuamer844 10 місяців тому

    I've reached this far yesterday and then my file got corrupted and I went back to the first video and I started over... and since I finished the 3rd module, my file got corrupted again and cannot be opened. I get this error now: "Excel cannot open the file 'Invoice Template.xlsm' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."

  • @mardarose1
    @mardarose1 8 місяців тому

    Hi, my invoice has a letter in the front and then a number, how do i write a macro to keep the letter but change the number only...thank you

  • @karishmakhorasi
    @karishmakhorasi 11 місяців тому

    Hello Sir I am using this formula =IFNA(VLOOKUP($B$9,Cust_list,2,0),"") but it is coming #Name?. How to solve this

  • @DM.10
    @DM.10 Рік тому

    Please help. I mean how should I add a new invoice number if it looks like this: NPJ/001/2023. I want to add 1 which is NPJ/002/2023???? Please reply. 🙏

  • @powerflex500
    @powerflex500 Рік тому

    When I use your formula to clear the #N/A in B10, it gives me #NAME? It doesn't clear the cell like in your video. Any help or suggestions would be appreciated. Thank you.

  • @larissahawkins5857
    @larissahawkins5857 Рік тому

    HELP, please help me. I created my boss a template that increments the invoice number by watching your video but he/we mistakenly hit "security warning macros have been disabled, enable content" at the top of one of the invoices we were working on and now for the life of me, i can not figure out how to fix it. I went to options and trust then macros and disable w/VBA notifications also tried w/o but neither worked. What am I doing wrong???

  • @alekyeremeef1152
    @alekyeremeef1152 29 днів тому

    Oh no that clearContent erased all formulas that i had done and saved it, there was no undo option. I'm using excel 2007

  • @azragamieldien2342
    @azragamieldien2342 Місяць тому

    Im stuck on the clear contents part.

  • @coolraghumiskin09
    @coolraghumiskin09 2 роки тому

    Want Alphanumeric Serial
    SHP/22-23/0001
    SHP/22-23/0002
    Only serial no. Has to change in this context
    How to do this is that possible. . ???

  • @gabz1989a
    @gabz1989a Рік тому

    2 questions from my side.
    When you save to excel, is there a way to keep a button? I would like to keep the save to PDF button on the save to excel version, as I would like to still modify the quotation and then save the final as PDF.
    second question
    I have the following, which keeps my logo and removed the buttons when you save, but I inserted my banking details at the bottom in a shape box and I tried adding a png at the bottom, but when I save it as excel, it removed the bottom part, this, however, doesn't happen when I save to pdf, it retains the detail at the bottom
    Dim shp As Shape
    For Each shp In ActiveSheet.Shapes
    If shp.Type msoPicture Then shp.Delete 'This line is modified so that is doesn't delete the logo
    Next shp