Add 1 to field in worksheets

  • Thread starter Thread starter Conchita
  • Start date Start date
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).
 
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
 
Back
Top