Invoice numbering

mikie1881

New Member
Joined
Jul 27, 2020
Messages
20
Office Version
  1. 2013
Platform
  1. Windows
Hi. I use to provide electronic invoice for my services, but every time i forgot the last invoice number. is it possible to get some help ? I thing will be perfect if after doing and save an new invoice to be archived with a invoice name ? and invoice template to remain blanc ?the invoice number have to be on L3 cell of my invoice. Thank you in advance
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
In the macro that saves your invoice, include :

Sheet("Name of the sheet here").Range("L3").Value = Sheet("Name of the sheet here").Range("L3").Value + 1
 
Upvote 0
Sheet("Name of the sheet here").Range("L3").Value = Sheet("Name of the sheet here").Range("L3").Value + 1
Many thanks for your answer but i dont understand since i know only the very basics of excell ! any way thank you again for your efort. mIkie
 
Upvote 0
Post your entire code for review.
i dont have any code but just a simple invoice. IAfter a searching on web i find thisw <<
sub SaveInvWithNewName ()
Dim newFN As variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN ="c:\new\Inv" & Range("l3").Value & ".xlsx
ActiveworkBook.SaveAs NewFN, FileFormat:=xlopenXMLworkbook
ActiveWorkBook.close
NextInvoice
End Sub

But i cant attach the code because when i tried was erase all the data from invoice..
I just want my new invoice to have new number and if it is possible to be saved after i use it.
Thank you again
Mikie
 
Upvote 0
I managed to create the code I need with the help of the internet, I created an active object on the sheet and when I clickit run the code, but in the new sheet it saves the active icon object appears, is there a way to save the file without the active object ?? the code is ::

Sub NextInvoice()
Range("L3").Value = Range("L3").Value + 1
Range("A13:K18").ClearContents

End Sub

Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "c:\aaa\Inv" & Range("l3").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub

Thank you for your help . Mikie
 
Upvote 0
Prior to the copy command, you can HIDE the object.

Then unhide the object at the end of your macro.
 
Upvote 0
I understand and thank you, one more question I would like you to explain to me, the code I attached to the previous message consists of two commands, Sub NextInvoice () and SaveInvWithNewName (), it is possible to compile the two commands in one so as not to you need two axtive objects, and it is possible you could do it because I do not have the necessary knowledge; Thank you Thank you very much Mikie P.S i ask apologise for my english
 
Upvote 0
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "c:\aaa\Inv" & Range("l3").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close

'''NextInvoice

Range("L3").Value = Range("L3").Value + 1
Range("A13:K18").ClearContents

End Sub
 
Upvote 0
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "c:\aaa\Inv" & Range("l3").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close

'''NextInvoice

Range("L3").Value = Range("L3").Value + 1
Range("A13:K18").ClearContents

End Sub
Hi, thank you for your reply and for the correction of the code , its perfect but one thing that maybe I didn’t explain to you well.

I have one invoice template and I use it to issue any new invoices, what I am try to do is after complete with client details on template invoice on cells A13:K18 and push the macro button the invoice to be saved on c\aa (as it is saved already) with the data on A13:K18 and the invoice template to be cleared (A13:k18)

Unfortunately now when I click the macro button the template invoice cleared on A13:K18 But the copy saved on c\aa\inv empty without any data on A13:K18

Once again thank you very much

Mikie
 
Upvote 0

Forum statistics

Threads
1,215,773
Messages
6,126,821
Members
449,340
Latest member
hpm23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top