Yet Another Invoice Numbering Issue

smdppl

New Member
Joined
Apr 7, 2015
Messages
7
Hi everyone,

First, I'd like to thank the collective community for their efforts in solving other people's excel issues as I've had many of the same problems. Secondly, I've looked all over the place and I've not been able to resolve my current issue with invoice numbering in an excel spreadsheet (macro enabled).

The issue: When I run my macro, my invoice numbers increase by two rather than one (eg. 1003 updates the new invoice as 1005, rather than 1004.) Here is my code used in Office 2007 (courtesy of many people on here, thank you!:biggrin:)

Sub Run_All_Macros()
Save_New
Next_Invoice
End Sub

Sub Save_New()
Dim NewFN As String
ActiveSheet.Copy
NewFN = "" & Range("e7").Value & ".xlsm"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbookMacroEnabled
ActiveWorkbook.Close
Next_Invoice
End Sub

Sub Next_Invoice()
Range("e5").Value = Range("e5").Value + 1
Range("b10:b14, e7, e8, b17:e32, e33").ClearContents
End Sub


I've tried changing the value to "Value + 0", but that had obvious effects since the invoice numbers didn't change. I suspect the issue lies in the method the code is run, or more so in the order it is run, but to change the order would wipe my data before it has been saved. No? Anyhow, thank you all (in advance) for your amazing help!

cheers,
shawn
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
You seem to be running "next_Invoice" twice !
Once in the Run_All_macros and also the last line in Sub Save_New
I'd remove the one in Run_All
 
Upvote 0
Solution
Oh my. How embarrassing!
That fixed it, thank you so much, Michael! :LOL:
Admin can close thread.
 
Upvote 0
:LOL:...maybe it's beer o clock, where you are...(y)
 
Upvote 0

Forum statistics

Threads
1,215,493
Messages
6,125,134
Members
449,206
Latest member
burgsrus

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