Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Macros for invoice

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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Macros for invoice

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

On Fri, 25 Apr 2008 08:17:02 -0700, Heather C
wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default Macros for invoice

Take a look here, covers what to do when you start to use an invoice and
then change your mind, to keep the invoice numbers in sequence instead of
advancing and therefore skipping one.

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

HTH
Regards,
Howard

"Heather C" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
invoice toolbar for invoice calcuation and assign number KarenY Excel Discussion (Misc queries) 15 March 16th 07 12:02 PM
How do I generate a new invoice number when creating new invoice? KiddieWonderland Excel Discussion (Misc queries) 1 March 15th 06 03:19 AM
missing invoice toolbar when save customised invoice M.G New Users to Excel 1 September 26th 05 07:18 AM
Invoice templet Excel97 to 2003 invoice toolbar missing MarolynInMarion Excel Discussion (Misc queries) 0 August 19th 05 07:15 PM
How do I change the invoice number assigned in Invoice template... akress Excel Discussion (Misc queries) 1 February 28th 05 06:36 PM


All times are GMT +1. The time now is 02:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"