LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default auto number question

Hi John,

I have some code that may do what you want. There is some MVP code out
there to increment invoice numbers and deals with invoices (quotes) that are
started and then canceled... so the number, if canceled, will not increment,
if processed then does increment. May be exactly what you want

JE McGimpsey has a site that deals with that, if I remember correctly. You
could Google that and see if that helps. I thought I had it in my archives
but can't find it. It takes on the many aspects of starting a quote and
then dismissing it and the number does not increase, or if you instigate it
then the number does increase.

A simple example might look like this. You would have to make sure you
click a button to increase the quote number, or click a button that does not
increment the number.

Sub OneMore()
Range("A1").Value = Range("A1").Value + 1
End Sub

My code relates to presenting a quote number that relates to a specific
customer, by name or number, and a specific service, by name or number and I
am sure you can add a time stamp to the end. It is a bit on the amateur
side but I believe it can be cleaned up to suit. It is a bit sloppy...!


Option Explicit

Sub SerialNo()
Dim h As Integer
Dim i As String
Dim j As String
Dim k As Integer
Dim l As Integer

l = Range("D1").Value + 1
Range("B2").Value = Chr(64 + l)

h = Range("A1").Value
i = Range("A2").Value
j = Range("A3").Value
k = Range("A4").Value
l = Range("D1").Value + 1
Range("B2").Value = Chr(64 + l)

Range("C100").End(xlUp).Offset(1, 0).Value = "SN" & "-" _
& h & " " & i & " / " & j & "-" & k
'Range("A4").Value = Range("A4").Value + 1

If l = 26 Then Range("B1").Value = Chr(65 + 1)
If l = 26 Then l = 0
Range("D1").Value = l

End Sub

HTH
Regards,
Howard

"John Carter" wrote in message
...
I have a template that is used as a quote sheet. We would like to have it
create a quote number automatically when the file is saved and not change
when the file is reopened.
We have thought about using the "now" function then kill the formula when
the file is saved on save but have not figured out how to do it.
any help would be appreciated.

thank you,
m




 
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
Auto Fill down question Gor_yee Excel Discussion (Misc queries) 0 August 5th 07 01:30 PM
Auto Number the Rows of Auto Filter Result ashish128 Excel Discussion (Misc queries) 3 April 29th 07 06:41 PM
auto increase number if number is double or more chapeau_melon Excel Worksheet Functions 4 March 28th 07 12:08 AM
Auto number w/ different letter-number combos in same column Colleen B Excel Worksheet Functions 2 February 23rd 05 02:41 PM
assign auto number and auto date Krit Kasem Excel Discussion (Misc queries) 2 January 14th 05 02:55 AM


All times are GMT +1. The time now is 02:08 PM.

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

About Us

"It's about Microsoft Excel"