View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Pre-numbered forms, I think its impossible, but...

Strider,

Depends what you mean by every time it is used, but let's assume you mean
every time it is opened. A simple workbook open event proc will handle it.
Again, I assume that the incremental number is on sheet 1 range A1, adjust
to suit

Private Sub Workbook_Open()

With Worksheets(1).Range("A1")
If Len(.Value) = 0 Or Not IsNumeric(.Value) Then
.Value = 1000
Else
.Value = .Value + 1
End If
End With

End Sub


This goes into the ThisWorkbook code module.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Strider" wrote in message
...
Does anyone know how to set up a 'master' form that is pre-numbered, or

auto advances with every use. Example: As the form is used, it is printed as
form number 1000, next use 1001, 1002 and so on. Need it to automatically
number it to avoid human error.

Currently using the form on one sheet, with a log on another. Have tried

using macro's, functions, etc. Can't seem to find the right combo. All
templates I have seen do not have auto numbering, so I have a feeling it is
beyond excel's capabilities, but just in case I missed something (new to
excel, former Lotus user, new job).

Using Excel 2002.

Thanks for your thoughts and/or ideas.