Add 1 to field in worksheets

C

Conchita

I am building a workbook that will eventually have 50 or
more worksheets. There is a field named Report Number in
spreadsheet. Is there a way to add 1 (for consecutive
numbering) to the Report Number field in each subsequent
worksheet when I copy the original worksheet? For
instance, if I am working on Report Number 10 and make a
copy of that worksheet for the next week, the new
worksheet will change to Report Number 11. I have looked
everywhere for help with this issue. Thank you in advance
for your help. I am using EXCEL 2000 (in Office 2000).
 
J

Jeff

try using a for each next loop to cycle through all the
worksheets. You would run this macro whenever you desired
to renumber them.

dim wks as worksheet
dim i as integer
i=1
for each wks in activeworkbook.worksheets
range("a1")="Report " & i
i=i+1
next i
 

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