Auto numbering

  • Thread starter Thread starter shaun collier
  • Start date Start date
S

shaun collier

Hi guys,
Wish to use auto numbering system for test sheets, i.e., every time I open
my test sheet, a cell with a number in automatically increments, is this
possible in excel?

Regards
Shaun
 
You can use a macro:

Option Explicit
Sub Auto_Open()

with thisworkbook
with worksheets("sheet9999").range("a1")
if isnumeric(.value) then
.value = .value + 1
end if
end with
.save
end with

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

I added a .save command to the code. Changing the value won't mean much if the
workbook is opened, but not saved.

On the other hand, if a user opens this file in error, the value is updated,
too.

You sure you want this automatic?
 
Back
Top