Macros for invoice

H

Heather C

I found a web sit that I copyed the data off of so it could have my invoice
number update automaticaly. I was wondering if thier was a way that it
wouldn't update untill I entered something into a specefic cell. What I mean
is I don't want the invoice number to update untill I enter the cumber number
inthe field. The code i'm using is
Private Sub Workbook_Open()
Const sAPPLICATION As String = "Excel"
Const sSECTION As String = "Invoice"
Const sKEY As String = "Invoice_key"
Const nDEFAULT As Long = 1&
Dim nNumber As Long

With ThisWorkbook.Sheets("Invoice")
With .Range("g6")
If IsEmpty(.Value) Then
.Value = Date
.NumberFormat = "mmmmmmmmmm dd, yyyy"
End If
End With
With .Range("g5")
If IsEmpty(.Value) Then
nNumber = GetSetting(sAPPLICATION, sSECTION, sKEY,
nDEFAULT)
.NumberFormat = "@"
.Value = Format(nNumber, "0000")
SaveSetting sAPPLICATION, sSECTION, sKEY, nNumber + 1&
End If
End With
End With
End Sub

I really don't need it to update the date I just didn't know how to get rid
of this code
 
G

Gord Dibben

If you just want to get rid of the code, right-click on the Excel Icon left of
"File" and hit "View Code".

Select the code lines and clear.

Alt + q to go back to the Excel window. Save the workbook..


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Snag in invoice generator. How to change the "series" 5
macros on an invoice 1
error in code 5
Invoice Numbers - Please Help! 3
Invoice Numbers 1
Append Invoice 22
Invoice Append 1
Vista registry virtualization 6

Top