Batch Naming of ranges

  • Thread starter Thread starter Andy Chan
  • Start date Start date
A

Andy Chan

Dear all,

There are 80 sheets in my workbook. I want to name the ranges A1:B20
with systematic names in these 80 sheets, say, student_01 for Sheet1!A1:B20,
student_02 for Sheet2!A1:B20, ..., student_80 for Sheet80!A1:B20. Can I name
these ranges easily? Thanks.

Best Regards,
Andy
 
Dim i As Long
For i = 1 To 80
Worksheets("Sheet" & i).Range("A1:B20").Name = "student_" &
Format(i, "00")
Next i


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Thanks, it works!

Bob Phillips said:
Dim i As Long
For i = 1 To 80
Worksheets("Sheet" & i).Range("A1:B20").Name = "student_" &
Format(i, "00")
Next i


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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

Back
Top