Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default code for auto numbering documents

hi,
can someone please help. i have the following code for saving the same
template with cosecutive document numbers on our network. a drive "Z" was
created where every document is saved, but what happens is that 4 computers
are used for quoting by different people and it seems as if every computer
generates its own range of numbers, starting at one off course. so it now
happens that the are 2 quotes with number 40177. is there a way of
correcting this?

the code is:
Sub SvMe()

Dim newFile As String, fName As String
fName = Range("K2") & "=" & Range("G11") & "," & Range("G12") & "=" &
Range("G9") & "=" & Range("B8") & "," & Range("B9").Value
newFile = fName & " " & Format$(Date, "dd-mm-yy")
' Change directory to suit your PC, including USER NAME

Dim Filename As Variant
ChDrive "Z"
ChDir "Z:\"
ActiveWorkbook.SaveAs Filename:=newFile

If TypeName(Filename) < "Boolean" Then
MsgBox Filename

End If

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default code for auto numbering documents

Maybe using a text file to keep track of the numbers would be ok:
http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

Look for: "Using a text file to hold sequential numbers"

des-sa wrote:

hi,
can someone please help. i have the following code for saving the same
template with cosecutive document numbers on our network. a drive "Z" was
created where every document is saved, but what happens is that 4 computers
are used for quoting by different people and it seems as if every computer
generates its own range of numbers, starting at one off course. so it now
happens that the are 2 quotes with number 40177. is there a way of
correcting this?

the code is:
Sub SvMe()

Dim newFile As String, fName As String
fName = Range("K2") & "=" & Range("G11") & "," & Range("G12") & "=" &
Range("G9") & "=" & Range("B8") & "," & Range("B9").Value
newFile = fName & " " & Format$(Date, "dd-mm-yy")
' Change directory to suit your PC, including USER NAME

Dim Filename As Variant
ChDrive "Z"
ChDir "Z:\"
ActiveWorkbook.SaveAs Filename:=newFile

If TypeName(Filename) < "Boolean" Then
MsgBox Filename

End If

End Sub


--

Dave Peterson
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
Auto Numbering Richard Excel Discussion (Misc queries) 3 January 21st 08 06:56 PM
Auto Numbering Starguy Excel Worksheet Functions 0 March 26th 06 11:51 PM
How to link diffrent documents with a sequence of page numbering? ndondo Excel Discussion (Misc queries) 0 March 10th 06 05:29 AM
sequence of page numbering from diffrent documents in to a footer ndondo Excel Discussion (Misc queries) 0 March 9th 06 09:59 AM
auto numbering Tricky Nicky Excel Discussion (Misc queries) 2 December 29th 04 05:44 PM


All times are GMT +1. The time now is 07:31 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"