Next number invoice +

PEAKCAB

New Member
Joined
Jul 16, 2018
Messages
49
Hello,

Please could anyone help me? I am running Bill's next invoice number macro and would also like to add another ref "our order" number to the sheet which would also increase by +1 and save on the sheet when the macro for the invoice runs.

thanks in advance

Rich
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Morning,

the cell that would like the other number in is C22

Sub NextInvoice()
Range("J22").Value = Range("J22").Value + 1
Range("C14:E20").ClearContents
Range("G157:J187").ClearContents
Range("A22").ClearContents
Range("C22").ClearContents
Range("E22").ClearContents
Range("J57").ClearContents
Range("J197").ClearContents
Range("G27:G51").ClearContents
Range("A25:A55").SpecialCells(xlCellTypeConstants).ClearContents
Range("H25:J55").SpecialCells(xlCellTypeConstants).ClearContents
Range("B25:B55").SpecialCells(xlCellTypeConstants).ClearContents

End Sub

Sub SaveInvWithNewName()
Dim NewFN As Variant
PostToRegister
'Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "Y:\Dropbox\Accounts\Accounts\Sales\DELIVERY NOTES\DN" & Range("J22").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice


Thanks,

Rich
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,517
Members
449,088
Latest member
RandomExceller01

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