Auto numbering

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
 
D

Dave Peterson

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top